This commit is contained in:
sriramphanib committed 2023-03-11 17:30:20 +00:00
commit b6c4e025bc
5124 files changed
+1153349

No files matched your search

+917
View File
@@ -0,0 +1,917 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator {
position: relative;
border: 1px solid #999;
background-color: #888;
font-size: 14px;
text-align: left;
overflow: hidden;
-ms-transform: translatez(0);
transform: translatez(0);
}
.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table {
min-width: 100%;
}
.tabulator.tabulator-block-select {
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.tabulator .tabulator-header {
position: relative;
box-sizing: border-box;
width: 100%;
border-bottom: 1px solid #999;
background-color: #e6e6e6;
color: #555;
font-weight: bold;
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: #e6e6e6;
text-align: left;
vertical-align: bottom;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-col.tabulator-moving {
position: absolute;
border: 1px solid #999;
background: #cdcdcd;
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-menu-button {
padding: 0 8px;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover {
cursor: pointer;
opacity: .6;
}
.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-arrow {
display: inline-block;
position: absolute;
top: 9px;
right: 8px;
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: -ms-flexbox;
display: flex;
border-top: 1px solid #aaa;
overflow: hidden;
margin-right: -1px;
}
.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.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: #cdcdcd;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #bbb;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #666;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow {
border-top: 6px solid #666;
border-bottom: none;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
text-orientation: mixed;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {
-ms-transform: rotate(180deg);
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-arrow {
right: calc(50% - 6px);
}
.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: #f3f3f3 !important;
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {
background: #f3f3f3 !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: -ms-flexbox;
display: flex;
-ms-flex-align: center;
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 span {
display: inline-block;
margin: 0 auto;
padding: 10px;
color: #ccc;
font-weight: bold;
font-size: 20px;
}
.tabulator .tabulator-tableHolder .tabulator-table {
position: relative;
display: inline-block;
background-color: #fff;
white-space: nowrap;
overflow: visible;
color: #333;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs {
font-weight: bold;
background: #e2e2e2 !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 {
padding: 5px 10px;
border-top: 1px solid #999;
background-color: #e6e6e6;
text-align: right;
color: #555;
font-weight: bold;
white-space: nowrap;
-ms-user-select: none;
user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
}
.tabulator .tabulator-footer .tabulator-calcs-holder {
box-sizing: border-box;
width: calc(100% + 20px);
margin: -5px -10px 5px -10px;
text-align: left;
background: #f3f3f3 !important;
border-bottom: 1px solid #aaa;
border-top: 1px solid #aaa;
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-paginator {
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 #aaa;
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 #aaa;
border-radius: 3px;
background: rgba(255, 255, 255, 0.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 {
cursor: pointer;
background: rgba(0, 0, 0, 0.2);
color: #fff;
}
.tabulator .tabulator-col-resize-handle {
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 5px;
}
.tabulator .tabulator-col-resize-handle.prev {
left: 0;
right: auto;
}
.tabulator .tabulator-col-resize-handle:hover {
cursor: ew-resize;
}
.tabulator .tabulator-loader {
position: absolute;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
top: 0;
left: 0;
z-index: 100;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.4);
text-align: center;
}
.tabulator .tabulator-loader .tabulator-loader-msg {
display: inline-block;
margin: 0 auto;
padding: 10px 20px;
border-radius: 10px;
background: #fff;
font-weight: bold;
font-size: 16px;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading {
border: 4px solid #333;
color: #000;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error {
border: 4px solid #D00;
color: #590000;
}
.tabulator-row {
position: relative;
box-sizing: border-box;
min-height: 22px;
background-color: #fff;
}
.tabulator-row.tabulator-row-even {
background-color: #EFEFEF;
}
.tabulator-row.tabulator-selectable:hover {
background-color: #bbb;
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 #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: 14px;
}
.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;
padding: 0;
}
.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {
border: 1px;
background: transparent;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail {
border: 1px solid #dd0000;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {
border: 1px;
background: transparent;
color: #dd0000;
}
.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.tabulator-row .tabulator-cell.tabulator-row-handle {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: 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: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: 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, 0.1);
overflow: hidden;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: 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: #fff;
font-weight: bold;
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 {
display: none;
}
.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 #aaa;
border-top: 1px solid #999;
padding: 5px;
padding-left: 10px;
background: #ccc;
font-weight: bold;
min-width: 100%;
}
.tabulator-row.tabulator-group:hover {
cursor: pointer;
background-color: rgba(0, 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-menu {
position: absolute;
display: inline-block;
box-sizing: border-box;
background: #fff;
border: 1px solid #aaa;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
font-size: 14px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-menu .tabulator-menu-item {
padding: 5px 10px;
-webkit-user-select: none;
-ms-user-select: none;
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: #EFEFEF;
}
.tabulator-menu .tabulator-menu-separator {
border-top: 1px solid #aaa;
}
.tabulator-edit-select-list {
position: absolute;
display: inline-block;
box-sizing: border-box;
max-height: 200px;
background: #fff;
border: 1px solid #aaa;
font-size: 14px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item {
padding: 4px;
color: #333;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item.active {
color: #fff;
background: #1D68CD;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item:hover {
cursor: pointer;
color: #fff;
background: #1D68CD;
}
.tabulator-edit-select-list .tabulator-edit-select-list-notice {
padding: 4px;
color: #333;
text-align: center;
}
.tabulator-edit-select-list .tabulator-edit-select-list-group {
border-bottom: 1px solid #aaa;
padding: 4px;
padding-top: 6px;
color: #333;
font-weight: bold;
}
.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-data-tree-control {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: 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, 0.1);
overflow: hidden;
}
.tabulator-print-table .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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;
}
+6
View File
@@ -0,0 +1,6 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator-tableHolder {
height: 100% !important;
}
.tabulator{position:relative;border:1px solid #999;background-color:#888;font-size:14px;text-align:left;overflow:hidden;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:#e6e6e6;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:#e6e6e6;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:#cdcdcd;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-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.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-arrow{display:inline-block;position:absolute;top:9px;right:8px;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:-ms-flexbox;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.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:#cdcdcd}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #666;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack: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-arrow{right:calc(50% - 6px)}.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:#f3f3f3!important;border-top:1px solid #aaa;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-header .tabulator-calcs-Line truncated
@@ -0,0 +1,920 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator {
position: relative;
border: 1px solid #333;
background-color: #222;
overflow: hidden;
font-size: 14px;
text-align: left;
-ms-transform: translatez(0);
transform: translatez(0);
}
.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table {
min-width: 100%;
}
.tabulator.tabulator-block-select {
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.tabulator .tabulator-header {
position: relative;
box-sizing: border-box;
width: 100%;
border-bottom: 1px solid #999;
background-color: #333;
color: #fff;
font-weight: bold;
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-color: #333;
text-align: left;
vertical-align: bottom;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-col.tabulator-moving {
position: absolute;
border: 1px solid #999;
background: #1a1a1a;
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-menu-button {
padding: 0 8px;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover {
cursor: pointer;
opacity: .6;
}
.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: #444;
color: #fff;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow {
display: inline-block;
position: absolute;
top: 9px;
right: 8px;
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: -ms-flexbox;
display: flex;
border-top: 1px solid #aaa;
overflow: hidden;
margin-right: -1px;
}
.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.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, .tabulator .tabulator-header .tabulator-col .tabulator-header-filter select {
border: 1px solid #999;
background: #444;
color: #fff;
}
.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: #1a1a1a;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #bbb;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #666;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow {
border-top: 6px solid #666;
border-bottom: none;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
text-orientation: mixed;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {
-ms-transform: rotate(180deg);
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-arrow {
right: calc(50% - 6px);
}
.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 #888;
}
.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right {
border-left: 2px solid #888;
}
.tabulator .tabulator-header .tabulator-calcs-holder {
box-sizing: border-box;
min-width: 600%;
background: #1a1a1a !important;
border-top: 1px solid #888;
border-bottom: 1px solid #aaa;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {
background: #1a1a1a !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: -ms-flexbox;
display: flex;
-ms-flex-align: center;
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 span {
display: inline-block;
margin: 0 auto;
padding: 10px;
color: #eee;
font-weight: bold;
font-size: 20px;
}
.tabulator .tabulator-tableHolder .tabulator-table {
position: relative;
display: inline-block;
background-color: #666;
white-space: nowrap;
overflow: visible;
color: #fff;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs {
font-weight: bold;
background: #373737 !important;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {
border-bottom: 2px solid #888;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {
border-top: 2px solid #888;
}
.tabulator .tabulator-col-resize-handle {
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 5px;
}
.tabulator .tabulator-col-resize-handle.prev {
left: 0;
right: auto;
}
.tabulator .tabulator-col-resize-handle:hover {
cursor: ew-resize;
}
.tabulator .tabulator-footer {
padding: 5px 10px;
border-top: 1px solid #999;
background-color: #333;
text-align: right;
color: #333;
font-weight: bold;
white-space: nowrap;
-ms-user-select: none;
user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
}
.tabulator .tabulator-footer .tabulator-calcs-holder {
box-sizing: border-box;
width: calc(100% + 20px);
margin: -5px -10px 5px -10px;
text-align: left;
background: #262626 !important;
border-bottom: 1px solid #888;
border-top: 1px solid #888;
overflow: hidden;
}
.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {
background: #262626 !important;
color: #fff;
}
.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-paginator label {
color: #fff;
}
.tabulator .tabulator-footer .tabulator-page-size {
display: inline-block;
margin: 0 5px;
padding: 2px 5px;
border: 1px solid #aaa;
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 #aaa;
border-radius: 3px;
background: rgba(255, 255, 255, 0.2);
color: #333;
font-family: inherit;
font-weight: inherit;
font-size: inherit;
}
.tabulator .tabulator-footer .tabulator-page.active {
color: #fff;
}
.tabulator .tabulator-footer .tabulator-page:disabled {
opacity: .5;
}
.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {
cursor: pointer;
background: rgba(0, 0, 0, 0.2);
color: #fff;
}
.tabulator .tabulator-loader {
position: absolute;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
top: 0;
left: 0;
z-index: 100;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.4);
text-align: center;
}
.tabulator .tabulator-loader .tabulator-loader-msg {
display: inline-block;
margin: 0 auto;
padding: 10px 20px;
border-radius: 10px;
background: #fff;
font-weight: bold;
font-size: 16px;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading {
border: 4px solid #333;
color: #000;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error {
border: 4px solid #D00;
color: #590000;
}
.tabulator-row {
position: relative;
box-sizing: border-box;
min-height: 22px;
background-color: #666;
}
.tabulator-row:nth-child(even) {
background-color: #444;
}
.tabulator-row.tabulator-selectable:hover {
background-color: #999;
cursor: pointer;
}
.tabulator-row.tabulator-selected {
background-color: #000;
}
.tabulator-row.tabulator-selected:hover {
background-color: #888;
cursor: pointer;
}
.tabulator-row.tabulator-moving {
position: absolute;
border-top: 1px solid #888;
border-bottom: 1px solid #888;
pointer-events: none !important;
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 #888;
}
.tabulator-row .tabulator-frozen.tabulator-frozen-right {
border-left: 2px solid #888;
}
.tabulator-row .tabulator-responsive-collapse {
box-sizing: border-box;
padding: 5px;
border-top: 1px solid #888;
border-bottom: 1px solid #888;
}
.tabulator-row .tabulator-responsive-collapse:empty {
display: none;
}
.tabulator-row .tabulator-responsive-collapse table {
font-size: 14px;
}
.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 #888;
vertical-align: middle;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tabulator-row .tabulator-cell.tabulator-editing {
border: 1px solid #999;
padding: 0;
}
.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {
border: 1px;
background: transparent;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail {
border: 1px solid #dd0000;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {
border: 1px;
background: transparent;
color: #dd0000;
}
.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.tabulator-row .tabulator-cell.tabulator-row-handle {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: 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 #888;
border-bottom: 2px solid #888;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: center;
align-items: center;
vertical-align: middle;
height: 11px;
width: 11px;
margin-right: 5px;
border: 1px solid #fff;
border-radius: 2px;
background: rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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: #fff;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand {
display: inline-block;
position: relative;
height: 7px;
width: 1px;
background: #fff;
}
.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: #fff;
}
.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: 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: #fff;
color: #666;
font-weight: bold;
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 {
display: none;
}
.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 #888;
border-top: 1px solid #999;
padding: 5px;
padding-left: 10px;
background: #ccc;
font-weight: bold;
color: #333;
min-width: 100%;
}
.tabulator-row.tabulator-group:hover {
cursor: pointer;
background-color: rgba(0, 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: #666;
}
.tabulator-menu {
position: absolute;
display: inline-block;
box-sizing: border-box;
background: #666;
border: 1px solid #888;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
font-size: 14px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-menu .tabulator-menu-item {
padding: 5px 10px;
-webkit-user-select: none;
-ms-user-select: none;
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: #444;
}
.tabulator-menu .tabulator-menu-separator {
border-top: 1px solid #888;
}
.tabulator-edit-select-list {
position: absolute;
display: inline-block;
box-sizing: border-box;
max-height: 200px;
background: #fff;
border: 1px solid #888;
font-size: 14px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item {
padding: 4px;
color: #666;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item.active {
color: #999;
background: #444;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item:hover {
cursor: pointer;
color: #999;
background: #666;
}
.tabulator-edit-select-list .tabulator-edit-select-list-notice {
padding: 4px;
color: #fff;
text-align: center;
}
.tabulator-edit-select-list .tabulator-edit-select-list-group {
border-bottom: 1px solid #888;
padding: 4px;
padding-top: 6px;
color: #fff;
font-weight: bold;
}
.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 #888;
border-bottom: 2px solid #888;
}
.tabulator-print-table .tabulator-data-tree-control {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: center;
align-items: center;
vertical-align: middle;
height: 11px;
width: 11px;
margin-right: 5px;
border: 1px solid #fff;
border-radius: 2px;
background: rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.tabulator-print-table .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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: #fff;
}
.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand {
display: inline-block;
position: relative;
height: 7px;
width: 1px;
background: #fff;
}
.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: #fff;
}
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator{position:relative;border:1px solid #333;background-color:#222;overflow:hidden;font-size:14px;text-align:left;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:#333;color:#fff;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-color:#333;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:#1a1a1a;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-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.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:#444;color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{display:inline-block;position:absolute;top:9px;right:8px;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:-ms-flexbox;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.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,.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select{border:1px solid #999;background:#444;color:#fff}.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:#1a1a1a}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #666;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack: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-arrow{right:calc(50% - 6px)}.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 #888}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #888}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:#1a1a1a!important;borLine truncated
@@ -0,0 +1,953 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator {
position: relative;
border: 1px solid #fff;
background-color: #fff;
overflow: hidden;
font-size: 16px;
text-align: left;
-ms-transform: translatez(0);
transform: translatez(0);
}
.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table {
min-width: 100%;
}
.tabulator.tabulator-block-select {
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.tabulator .tabulator-header {
position: relative;
box-sizing: border-box;
width: 100%;
border-bottom: 3px solid #3759D7;
margin-bottom: 4px;
background-color: #fff;
color: #3759D7;
font-weight: bold;
white-space: nowrap;
overflow: hidden;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
padding-left: 10px;
font-size: 1.1em;
}
.tabulator .tabulator-header.tabulator-header-hidden {
display: none;
}
.tabulator .tabulator-header .tabulator-col {
display: inline-block;
position: relative;
box-sizing: border-box;
border-right: 2px solid #fff;
background-color: #fff;
text-align: left;
vertical-align: bottom;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-col.tabulator-moving {
position: absolute;
border: 1px solid #3759D7;
background: #e6e6e6;
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-menu-button {
padding: 0 8px;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover {
cursor: pointer;
opacity: .6;
}
.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 #3759D7;
padding: 1px;
background: #fff;
font-size: 1em;
color: #3759D7;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow {
display: inline-block;
position: absolute;
top: 9px;
right: 8px;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #b7c3f1;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {
position: relative;
display: -ms-flexbox;
display: flex;
border-top: 2px solid #3759D7;
overflow: hidden;
margin-right: -1px;
}
.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.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: #e6e6e6;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #b7c3f1;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #3759D7;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow {
border-top: 6px solid #3759D7;
border-bottom: none;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
text-orientation: mixed;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {
-ms-transform: rotate(180deg);
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-arrow {
right: calc(50% - 6px);
}
.tabulator .tabulator-header .tabulator-frozen {
display: inline-block;
position: absolute;
z-index: 10;
}
.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left {
padding-left: 10px;
border-right: 2px solid #fff;
}
.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right {
border-left: 2px solid #fff;
}
.tabulator .tabulator-header .tabulator-calcs-holder {
box-sizing: border-box;
min-width: 600%;
border-top: 2px solid #3759D7 !important;
background: white !important;
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {
padding-left: 0 !important;
background: white !important;
}
.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {
display: none;
}
.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-cell {
background: 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: -ms-flexbox;
display: flex;
-ms-flex-align: center;
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 span {
display: inline-block;
margin: 0 auto;
padding: 10px;
color: #3759D7;
font-weight: bold;
font-size: 20px;
}
.tabulator .tabulator-tableHolder .tabulator-table {
position: relative;
display: inline-block;
background-color: #f3f3f3;
white-space: nowrap;
overflow: visible;
color: #333;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs {
font-weight: bold;
background: #f2f2f2 !important;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {
border-bottom: 2px solid #3759D7;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {
border-top: 2px solid #3759D7;
}
.tabulator .tabulator-col-resize-handle {
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 5px;
}
.tabulator .tabulator-col-resize-handle.prev {
left: 0;
right: auto;
}
.tabulator .tabulator-col-resize-handle:hover {
cursor: ew-resize;
}
.tabulator .tabulator-footer {
padding: 5px 10px;
border-top: 1px solid #999;
background-color: #fff;
text-align: right;
color: #3759D7;
font-weight: bold;
white-space: nowrap;
-ms-user-select: none;
user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
}
.tabulator .tabulator-footer .tabulator-calcs-holder {
box-sizing: border-box;
width: calc(100% + 20px);
margin: -5px -10px 5px -10px;
text-align: left;
background: white !important;
border-top: 3px solid #3759D7 !important;
border-bottom: 2px solid #3759D7 !important;
border-bottom: 1px solid #fff;
border-top: 1px solid #fff;
overflow: hidden;
}
.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {
background: white !important;
}
.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {
display: none;
}
.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell {
background: none;
}
.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-cell:first-child {
border-left: 10px solid transparent;
}
.tabulator .tabulator-footer .tabulator-calcs-holder:only-child {
margin-bottom: -5px;
border-bottom: none;
border-bottom: none !important;
}
.tabulator .tabulator-footer .tabulator-paginator {
color: #3759D7;
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 #aaa;
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 #aaa;
border-radius: 3px;
background: rgba(255, 255, 255, 0.2);
}
.tabulator .tabulator-footer .tabulator-page.active {
color: #3759D7;
}
.tabulator .tabulator-footer .tabulator-page:disabled {
opacity: .5;
}
.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {
cursor: pointer;
background: rgba(0, 0, 0, 0.2);
color: #fff;
}
.tabulator .tabulator-loader {
position: absolute;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
top: 0;
left: 0;
z-index: 100;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.4);
text-align: center;
}
.tabulator .tabulator-loader .tabulator-loader-msg {
display: inline-block;
margin: 0 auto;
padding: 10px 20px;
border-radius: 10px;
background: #fff;
font-weight: bold;
font-size: 16px;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading {
border: 4px solid #333;
color: #000;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error {
border: 4px solid #D00;
color: #590000;
}
.tabulator-row {
position: relative;
box-sizing: border-box;
box-sizing: border-box;
min-height: 24px;
margin-bottom: 2px;
}
.tabulator-row .tabulator-cell:first-child {
border-left: 10px solid #3759D7;
}
.tabulator-row:nth-child(even) {
background-color: #627ce0;
}
.tabulator-row:nth-child(even) .tabulator-cell {
background-color: #fff;
}
.tabulator-row:nth-child(even) .tabulator-cell:first-child {
border-left: 10px solid #627ce0;
}
.tabulator-row.tabulator-selectable:hover {
cursor: pointer;
}
.tabulator-row.tabulator-selectable:hover .tabulator-cell {
background-color: #bbb;
}
.tabulator-row.tabulator-selected .tabulator-cell {
background-color: #9ABCEA;
}
.tabulator-row.tabulator-selected:hover .tabulator-cell {
background-color: #769BCC;
cursor: pointer;
}
.tabulator-row.tabulator-moving {
position: absolute;
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
pointer-events: none !important;
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 #fff;
}
.tabulator-row .tabulator-frozen.tabulator-frozen-right {
border-left: 2px solid #fff;
}
.tabulator-row .tabulator-responsive-collapse {
box-sizing: border-box;
padding: 5px;
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
}
.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: 6px 4px;
border-right: 2px solid #fff;
vertical-align: middle;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
background-color: #f3f3f3;
}
.tabulator-row .tabulator-cell.tabulator-editing {
border: 1px solid #1D68CD;
padding: 0;
}
.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {
border: 1px;
background: transparent;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail {
border: 1px solid #dd0000;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {
border: 1px;
background: transparent;
color: #dd0000;
}
.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.tabulator-row .tabulator-cell.tabulator-row-handle {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: 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 #fff;
border-bottom: 2px solid #fff;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: 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, 0.1);
overflow: hidden;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: 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: #f3f3f3;
font-weight: bold;
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 {
display: none;
}
.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: 2px solid #3759D7;
border-top: 2px solid #3759D7;
padding: 5px;
padding-left: 10px;
background: #8ca0e8;
font-weight: bold;
color: fff;
margin-bottom: 2px;
min-width: 100%;
}
.tabulator-row.tabulator-group:hover {
cursor: pointer;
background-color: rgba(0, 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 #3759D7;
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 #3759D7;
vertical-align: middle;
}
.tabulator-row.tabulator-group span {
margin-left: 10px;
color: #3759D7;
}
.tabulator-menu {
position: absolute;
display: inline-block;
box-sizing: border-box;
background: #f3f3f3;
border: 1px solid #fff;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
font-size: 16px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-menu .tabulator-menu-item {
padding: 5px 10px;
-webkit-user-select: none;
-ms-user-select: none;
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: #fff;
}
.tabulator-menu .tabulator-menu-separator {
border-top: 1px solid #fff;
}
.tabulator-edit-select-list {
position: absolute;
display: inline-block;
box-sizing: border-box;
max-height: 200px;
background: #f3f3f3;
border: 1px solid #1D68CD;
font-size: 16px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item {
padding: 4px;
color: #333;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item.active {
color: #f3f3f3;
background: #1D68CD;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item:hover {
cursor: pointer;
color: #f3f3f3;
background: #1D68CD;
}
.tabulator-edit-select-list .tabulator-edit-select-list-notice {
padding: 4px;
color: #333;
text-align: center;
}
.tabulator-edit-select-list .tabulator-edit-select-list-group {
border-bottom: 1px solid #fff;
padding: 4px;
padding-top: 6px;
color: #333;
font-weight: bold;
}
.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 #fff;
border-bottom: 2px solid #fff;
}
.tabulator-print-table .tabulator-data-tree-control {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: 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, 0.1);
overflow: hidden;
}
.tabulator-print-table .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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;
}
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator{position:relative;border:1px solid #fff;background-color:#fff;overflow:hidden;font-size:16px;text-align:left;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:3px solid #3759d7;margin-bottom:4px;background-color:#fff;color:#3759d7;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;padding-left:10px;font-size:1.1em}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:2px solid #fff;background-color:#fff;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #3759d7;background:#e6e6e6;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-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.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 #3759d7;padding:1px;background:#fff;font-size:1em;color:#3759d7}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{display:inline-block;position:absolute;top:9px;right:8px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #b7c3f1}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:-ms-flexbox;display:flex;border-top:2px solid #3759d7;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.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:#e6e6e6}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #b7c3f1}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #3759d7}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #3759d7;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack: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-arrow{right:calc(50% - 6px)}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{padding-left:10px;border-right:2px solid #fff}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #fff}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;border-top:2px solid #3759d7!important;background:#fff!important;border-top:1px solid #fff;border-bottom:1px solid #ffLine truncated
@@ -0,0 +1,914 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator {
position: relative;
background-color: #fff;
overflow: hidden;
font-size: 14px;
text-align: left;
-ms-transform: translatez(0);
transform: translatez(0);
}
.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table {
min-width: 100%;
}
.tabulator.tabulator-block-select {
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.tabulator .tabulator-header {
position: relative;
box-sizing: border-box;
width: 100%;
border-bottom: 1px solid #999;
background-color: #fff;
color: #555;
font-weight: bold;
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 #ddd;
background-color: #fff;
text-align: left;
vertical-align: bottom;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-col.tabulator-moving {
position: absolute;
border: 1px solid #999;
background: #e6e6e6;
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-menu-button {
padding: 0 8px;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover {
cursor: pointer;
opacity: .6;
}
.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-arrow {
display: inline-block;
position: absolute;
top: 9px;
right: 8px;
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: -ms-flexbox;
display: flex;
border-top: 1px solid #ddd;
overflow: hidden;
margin-right: -1px;
}
.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.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: #e6e6e6;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #bbb;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #666;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow {
border-top: 6px solid #666;
border-bottom: none;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
text-orientation: mixed;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {
-ms-transform: rotate(180deg);
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-arrow {
right: calc(50% - 6px);
}
.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 #ddd;
}
.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right {
border-left: 2px solid #ddd;
}
.tabulator .tabulator-header .tabulator-calcs-holder {
box-sizing: border-box;
min-width: 600%;
background: #f2f2f2 !important;
border-top: 1px solid #ddd;
border-bottom: 1px solid #999;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {
background: #f2f2f2 !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: -ms-flexbox;
display: flex;
-ms-flex-align: center;
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 span {
display: inline-block;
margin: 0 auto;
padding: 10px;
color: #000;
font-weight: bold;
font-size: 20px;
}
.tabulator .tabulator-tableHolder .tabulator-table {
position: relative;
display: inline-block;
background-color: #fff;
white-space: nowrap;
overflow: visible;
color: #333;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs {
font-weight: bold;
background: #f2f2f2 !important;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {
border-bottom: 2px solid #ddd;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {
border-top: 2px solid #ddd;
}
.tabulator .tabulator-col-resize-handle {
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 5px;
}
.tabulator .tabulator-col-resize-handle.prev {
left: 0;
right: auto;
}
.tabulator .tabulator-col-resize-handle:hover {
cursor: ew-resize;
}
.tabulator .tabulator-footer {
padding: 5px 10px;
border-top: 1px solid #999;
background-color: #fff;
text-align: right;
color: #555;
font-weight: bold;
white-space: nowrap;
-ms-user-select: none;
user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
}
.tabulator .tabulator-footer .tabulator-calcs-holder {
box-sizing: border-box;
width: calc(100% + 20px);
margin: -5px -10px 5px -10px;
text-align: left;
background: #f2f2f2 !important;
border-bottom: 1px solid #fff;
border-top: 1px solid #ddd;
overflow: hidden;
}
.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {
background: #f2f2f2 !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-paginator {
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 #aaa;
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 #aaa;
border-radius: 3px;
background: rgba(255, 255, 255, 0.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 {
cursor: pointer;
background: rgba(0, 0, 0, 0.2);
color: #fff;
}
.tabulator .tabulator-loader {
position: absolute;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
top: 0;
left: 0;
z-index: 100;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.4);
text-align: center;
}
.tabulator .tabulator-loader .tabulator-loader-msg {
display: inline-block;
margin: 0 auto;
padding: 10px 20px;
border-radius: 10px;
background: #fff;
font-weight: bold;
font-size: 16px;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading {
border: 4px solid #333;
color: #000;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error {
border: 4px solid #D00;
color: #590000;
}
.tabulator-row {
position: relative;
box-sizing: border-box;
min-height: 22px;
background-color: #fff;
border-bottom: 1px solid #ddd;
}
.tabulator-row:nth-child(even) {
background-color: #fff;
}
.tabulator-row.tabulator-selectable:hover {
background-color: #bbb;
cursor: pointer;
}
.tabulator-row.tabulator-selected {
background-color: #9ABCEA;
}
.tabulator-row.tabulator-selected:hover {
background-color: #769BCC;
cursor: pointer;
}
.tabulator-row.tabulator-moving {
position: absolute;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
pointer-events: none !important;
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 #ddd;
}
.tabulator-row .tabulator-frozen.tabulator-frozen-right {
border-left: 2px solid #ddd;
}
.tabulator-row .tabulator-responsive-collapse {
box-sizing: border-box;
padding: 5px;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
.tabulator-row .tabulator-responsive-collapse:empty {
display: none;
}
.tabulator-row .tabulator-responsive-collapse table {
font-size: 14px;
}
.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 #ddd;
vertical-align: middle;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tabulator-row .tabulator-cell:last-of-type {
border-right: none;
}
.tabulator-row .tabulator-cell.tabulator-editing {
border: 1px solid #1D68CD;
padding: 0;
}
.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {
border: 1px;
background: transparent;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail {
border: 1px solid #dd0000;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {
border: 1px;
background: transparent;
color: #dd0000;
}
.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.tabulator-row .tabulator-cell.tabulator-row-handle {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: 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 #ddd;
border-bottom: 2px solid #ddd;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: 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, 0.1);
overflow: hidden;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: 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: #fff;
font-weight: bold;
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 {
display: none;
}
.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 #ddd;
border-top: 1px solid #999;
padding: 5px;
padding-left: 10px;
background: #fafafa;
font-weight: bold;
min-width: 100%;
}
.tabulator-row.tabulator-group:hover {
cursor: pointer;
background-color: rgba(0, 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: #666;
}
.tabulator-menu {
position: absolute;
display: inline-block;
box-sizing: border-box;
background: #fff;
border: 1px solid #ddd;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
font-size: 14px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-menu .tabulator-menu-item {
padding: 5px 10px;
-webkit-user-select: none;
-ms-user-select: none;
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: #fff;
}
.tabulator-menu .tabulator-menu-separator {
border-top: 1px solid #ddd;
}
.tabulator-edit-select-list {
position: absolute;
display: inline-block;
box-sizing: border-box;
max-height: 200px;
background: #fff;
border: 1px solid #ddd;
font-size: 14px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item {
padding: 4px;
color: #333;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item.active {
color: #fff;
background: #1D68CD;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item:hover {
cursor: pointer;
color: #fff;
background: #1D68CD;
}
.tabulator-edit-select-list .tabulator-edit-select-list-notice {
padding: 4px;
color: #333;
text-align: center;
}
.tabulator-edit-select-list .tabulator-edit-select-list-group {
border-bottom: 1px solid #ddd;
padding: 4px;
padding-top: 6px;
color: #333;
font-weight: bold;
}
.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 #ddd;
border-bottom: 2px solid #ddd;
}
.tabulator-print-table .tabulator-data-tree-control {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: 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, 0.1);
overflow: hidden;
}
.tabulator-print-table .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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;
}
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator{position:relative;background-color:#fff;overflow:hidden;font-size:14px;text-align:left;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:#fff;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 #ddd;background-color:#fff;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:#e6e6e6;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-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.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-arrow{display:inline-block;position:absolute;top:9px;right:8px;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:-ms-flexbox;display:flex;border-top:1px solid #ddd;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.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:#e6e6e6}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #666;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack: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-arrow{right:calc(50% - 6px)}.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 #ddd}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #ddd}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:#f2f2f2!important;border-top:1px solid #ddd;border-bottom:1px solid #999;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#f2f2f2!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row Line truncated
@@ -0,0 +1,914 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator {
position: relative;
border-bottom: 5px solid #222;
background-color: #fff;
font-size: 14px;
text-align: left;
overflow: hidden;
-ms-transform: translatez(0);
transform: translatez(0);
}
.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table {
min-width: 100%;
}
.tabulator[tabulator-layout="fitColumns"] .tabulator-row .tabulator-cell:last-of-type {
border-right: none;
}
.tabulator.tabulator-block-select {
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.tabulator .tabulator-header {
position: relative;
box-sizing: border-box;
width: 100%;
border-bottom: 3px solid #3FB449;
background-color: #222;
color: #fff;
font-weight: bold;
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-color: #222;
text-align: left;
vertical-align: bottom;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-col.tabulator-moving {
position: absolute;
border: 1px solid #3FB449;
background: #090909;
pointer-events: none;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
box-sizing: border-box;
position: relative;
padding: 8px;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button {
padding: 0 8px;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover {
cursor: pointer;
opacity: .6;
}
.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-arrow {
display: inline-block;
position: absolute;
top: 14px;
right: 8px;
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: -ms-flexbox;
display: flex;
border-top: 1px solid #aaa;
overflow: hidden;
margin-right: -1px;
}
.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.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: #090909;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #bbb;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow {
border-top: none;
border-bottom: 6px solid #3FB449;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow {
border-top: 6px solid #3FB449;
border-bottom: none;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
text-orientation: mixed;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
}
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {
-ms-transform: rotate(180deg);
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-arrow {
right: calc(50% - 6px);
}
.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: #3c3c3c !important;
border-top: 1px solid #aaa;
overflow: hidden;
}
.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {
background: #3c3c3c !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: -ms-flexbox;
display: flex;
-ms-flex-align: center;
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 span {
display: inline-block;
margin: 0 auto;
padding: 10px;
color: #3FB449;
font-weight: bold;
font-size: 20px;
}
.tabulator .tabulator-tableHolder .tabulator-table {
position: relative;
display: inline-block;
background-color: #fff;
white-space: nowrap;
overflow: visible;
color: #333;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs {
font-weight: bold;
background: #484848 !important;
color: #fff;
}
.tabulator .tabulator-footer {
padding: 5px 10px;
padding-top: 8px;
border-top: 3px solid #3FB449;
background-color: #222;
text-align: right;
color: #222;
font-weight: bold;
white-space: nowrap;
-ms-user-select: none;
user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
}
.tabulator .tabulator-footer .tabulator-calcs-holder {
box-sizing: border-box;
width: calc(100% + 20px);
margin: -8px -10px 8px -10px;
text-align: left;
background: #3c3c3c !important;
border-bottom: 1px solid #aaa;
overflow: hidden;
}
.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {
background: #3c3c3c !important;
color: #fff !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-paginator label {
color: #fff;
}
.tabulator .tabulator-footer .tabulator-page-size {
display: inline-block;
margin: 0 5px;
padding: 2px 5px;
border: 1px solid #aaa;
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 #aaa;
border-radius: 3px;
background: #fff;
color: #222;
font-family: inherit;
font-weight: inherit;
font-size: inherit;
}
.tabulator .tabulator-footer .tabulator-page.active {
color: #3FB449;
}
.tabulator .tabulator-footer .tabulator-page:disabled {
opacity: .5;
}
.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {
cursor: pointer;
background: rgba(0, 0, 0, 0.2);
color: #fff;
}
.tabulator .tabulator-col-resize-handle {
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 5px;
}
.tabulator .tabulator-col-resize-handle.prev {
left: 0;
right: auto;
}
.tabulator .tabulator-col-resize-handle:hover {
cursor: ew-resize;
}
.tabulator .tabulator-loader {
position: absolute;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
top: 0;
left: 0;
z-index: 100;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.4);
text-align: center;
}
.tabulator .tabulator-loader .tabulator-loader-msg {
display: inline-block;
margin: 0 auto;
padding: 10px 20px;
border-radius: 10px;
background: #fff;
font-weight: bold;
font-size: 16px;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading {
border: 4px solid #333;
color: #000;
}
.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error {
border: 4px solid #D00;
color: #590000;
}
.tabulator-row {
position: relative;
box-sizing: border-box;
min-height: 22px;
background-color: #fff;
}
.tabulator-row.tabulator-row-even {
background-color: #EFEFEF;
}
.tabulator-row.tabulator-selectable:hover {
background-color: #bbb;
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 #aaa;
border-bottom: 1px solid #aaa;
pointer-events: none !important;
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: 14px;
}
.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: 6px;
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;
padding: 0;
}
.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {
border: 1px;
background: transparent;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail {
border: 1px solid #dd0000;
}
.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {
border: 1px;
background: transparent;
color: #dd0000;
}
.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev {
display: none;
}
.tabulator-row .tabulator-cell.tabulator-row-handle {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: 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: #3FB449;
}
.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: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: 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, 0.1);
overflow: hidden;
}
.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: 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: #fff;
font-weight: bold;
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 {
display: none;
}
.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;
border-top: 1px solid #000;
border-bottom: 2px solid #3FB449;
padding: 5px;
padding-left: 10px;
background: #222;
color: #fff;
font-weight: bold;
min-width: 100%;
}
.tabulator-row.tabulator-group:hover {
cursor: pointer;
background-color: #090909;
}
.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 #3FB449;
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 #3FB449;
vertical-align: middle;
}
.tabulator-row.tabulator-group span {
margin-left: 10px;
color: #3FB449;
}
.tabulator-menu {
position: absolute;
display: inline-block;
box-sizing: border-box;
background: #fff;
border: 1px solid #aaa;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
font-size: 14px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-menu .tabulator-menu-item {
padding: 5px 10px;
-webkit-user-select: none;
-ms-user-select: none;
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: #EFEFEF;
}
.tabulator-menu .tabulator-menu-separator {
border-top: 1px solid #aaa;
}
.tabulator-edit-select-list {
position: absolute;
display: inline-block;
box-sizing: border-box;
max-height: 200px;
background: #fff;
border: 1px solid #aaa;
font-size: 14px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
z-index: 10000;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item {
padding: 4px;
color: #333;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item.active {
color: #fff;
background: #1D68CD;
}
.tabulator-edit-select-list .tabulator-edit-select-list-item:hover {
cursor: pointer;
color: #fff;
background: #1D68CD;
}
.tabulator-edit-select-list .tabulator-edit-select-list-notice {
padding: 4px;
color: #333;
text-align: center;
}
.tabulator-edit-select-list .tabulator-edit-select-list-group {
border-bottom: 1px solid #aaa;
padding: 4px;
padding-top: 6px;
color: #333;
font-weight: bold;
}
.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-data-tree-control {
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: 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, 0.1);
overflow: hidden;
}
.tabulator-print-table .tabulator-data-tree-control:hover {
cursor: pointer;
background: rgba(0, 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;
}
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
.tabulator{position:relative;border-bottom:5px solid #222;background-color:#fff;font-size:14px;text-align:left;overflow:hidden;transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableHolder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitColumns] .tabulator-row .tabulator-cell:last-of-type{border-right:none}.tabulator.tabulator-block-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:3px solid #3fb449;background-color:#222;color:#fff;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-color:#222;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #3fb449;background:#090909;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.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-arrow{display:inline-block;position:absolute;top:14px;right:8px;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:-ms-flexbox;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.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:#090909}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-arrow{border-top:none;border-bottom:6px solid #3fb449}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-arrow{border-top:6px solid #3fb449;border-bottom:none}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{-ms-writing-mode:tb-rl;writing-mode:vertical-rl;text-orientation:mixed;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack: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-arrow{right:calc(50% - 6px)}.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:#3c3c3c!important;border-top:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holdLine truncated
+52
View File
@@ -0,0 +1,52 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
/*
* This file is part of the Tabulator package.
*
* (c) Oliver Folkerd <oliver.folkerd@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Full Documentation & Demos can be found at: http://olifolkerd.github.io/tabulator/
*
*/
(function (factory) {
"use strict";
if (typeof define === 'function' && define.amd) {
define(['jquery', 'tabulator', 'jquery-ui'], factory);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory(require('jquery'), require('tabulator'), require('jquery-ui'));
} else {
factory(jQuery, Tabulator);
}
})(function ($, Tabulator) {
$.widget("ui.tabulator", {
_create: function _create() {
var options = Object.assign({}, this.options);
delete options.create;
delete options.disabled;
this.table = new Tabulator(this.element[0], options);
//map tabulator functions to jquery wrapper
for (var key in Tabulator.prototype) {
if (typeof Tabulator.prototype[key] === "function" && key.charAt(0) !== "_") {
this[key] = this.table[key].bind(this.table);
}
}
},
_setOption: function _setOption(option, value) {
console.error("Tabulator jQuery wrapper does not support setting options after the table has been instantiated");
},
_destroy: function _destroy(option, value) {
this.table.destroy();
}
});
});
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","tabulator","jquery-ui"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery"),require("tabulator"),require("jquery-ui")):e(jQuery,Tabulator)}(function(e,t){e.widget("ui.tabulator",{_create:function(){var e=Object.assign({},this.options);delete e.create,delete e.disabled,this.table=new t(this.element[0],e);for(var o in t.prototype)"function"==typeof t.prototype[o]&&"_"!==o.charAt(0)&&(this[o]=this.table[o].bind(this.table))},_setOption:function(e,t){console.error("Tabulator jQuery wrapper does not support setting options after the table has been instantiated")},_destroy:function(e,t){this.table.destroy()}})});
@@ -0,0 +1,93 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Accessor = function Accessor(table) {
this.table = table; //hold Tabulator object
this.allowedTypes = ["", "data", "download", "clipboard", "print", "htmlOutput"]; //list of accessor types
};
//initialize column accessor
Accessor.prototype.initializeColumn = function (column) {
var self = this,
match = false,
config = {};
this.allowedTypes.forEach(function (type) {
var key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)),
accessor;
if (column.definition[key]) {
accessor = self.lookupAccessor(column.definition[key]);
if (accessor) {
match = true;
config[key] = {
accessor: accessor,
params: column.definition[key + "Params"] || {}
};
}
}
});
if (match) {
column.modules.accessor = config;
}
};
Accessor.prototype.lookupAccessor = function (value) {
var accessor = false;
//set column accessor
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) {
case "string":
if (this.accessors[value]) {
accessor = this.accessors[value];
} else {
console.warn("Accessor Error - No such accessor found, ignoring: ", value);
}
break;
case "function":
accessor = value;
break;
}
return accessor;
};
//apply accessor to row
Accessor.prototype.transformRow = function (dataIn, type) {
var self = this,
key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1));
//clone data object with deep copy to isolate internal data from returned result
var data = Tabulator.prototype.helpers.deepClone(dataIn || {});
self.table.columnManager.traverse(function (column) {
var value, accessor, params, component;
if (column.modules.accessor) {
accessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;
if (accessor) {
value = column.getFieldValue(data);
if (value != "undefined") {
component = column.getComponent();
params = typeof accessor.params === "function" ? accessor.params(value, data, type, component) : accessor.params;
column.setFieldValue(data, accessor.accessor(value, data, type, params, component));
}
}
}
});
return data;
},
//default accessors
Accessor.prototype.accessors = {};
Tabulator.prototype.registerModule("accessor", Accessor);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Accessor=function(o){this.table=o,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};Accessor.prototype.initializeColumn=function(o){var e=this,s=!1,r={};this.allowedTypes.forEach(function(t){var c,a="accessor"+(t.charAt(0).toUpperCase()+t.slice(1));o.definition[a]&&(c=e.lookupAccessor(o.definition[a]))&&(s=!0,r[a]={accessor:c,params:o.definition[a+"Params"]||{}})}),s&&(o.modules.accessor=r)},Accessor.prototype.lookupAccessor=function(o){var e=!1;switch(void 0===o?"undefined":_typeof(o)){case"string":this.accessors[o]?e=this.accessors[o]:console.warn("Accessor Error - No such accessor found, ignoring: ",o);break;case"function":e=o}return e},Accessor.prototype.transformRow=function(o,e){var s=this,r="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),t=Tabulator.prototype.helpers.deepClone(o||{});return s.table.columnManager.traverse(function(o){var s,c,a,n;o.modules.accessor&&(c=o.modules.accessor[r]||o.modules.accessor.accessor||!1)&&"undefined"!=(s=o.getFieldValue(t))&&(n=o.getComponent(),a="function"==typeof c.params?c.params(s,t,e,n):c.params,o.setFieldValue(t,c.accessor(s,t,e,a,n)))}),t},Accessor.prototype.accessors={},Tabulator.prototype.registerModule("accessor",Accessor);
+465
View File
@@ -0,0 +1,465 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Ajax = function Ajax(table) {
this.table = table; //hold Tabulator object
this.config = false; //hold config object for ajax request
this.url = ""; //request URL
this.urlGenerator = false;
this.params = false; //request parameters
this.loaderElement = this.createLoaderElement(); //loader message div
this.msgElement = this.createMsgElement(); //message element
this.loadingElement = false;
this.errorElement = false;
this.loaderPromise = false;
this.progressiveLoad = false;
this.loading = false;
this.requestOrder = 0; //prevent requests comming out of sequence if overridden by another load request
};
//initialize setup options
Ajax.prototype.initialize = function () {
var template;
this.loaderElement.appendChild(this.msgElement);
if (this.table.options.ajaxLoaderLoading) {
if (typeof this.table.options.ajaxLoaderLoading == "string") {
template = document.createElement('template');
template.innerHTML = this.table.options.ajaxLoaderLoading.trim();
this.loadingElement = template.content.firstChild;
} else {
this.loadingElement = this.table.options.ajaxLoaderLoading;
}
}
this.loaderPromise = this.table.options.ajaxRequestFunc || this.defaultLoaderPromise;
this.urlGenerator = this.table.options.ajaxURLGenerator || this.defaultURLGenerator;
if (this.table.options.ajaxLoaderError) {
if (typeof this.table.options.ajaxLoaderError == "string") {
template = document.createElement('template');
template.innerHTML = this.table.options.ajaxLoaderError.trim();
this.errorElement = template.content.firstChild;
} else {
this.errorElement = this.table.options.ajaxLoaderError;
}
}
if (this.table.options.ajaxParams) {
this.setParams(this.table.options.ajaxParams);
}
if (this.table.options.ajaxConfig) {
this.setConfig(this.table.options.ajaxConfig);
}
if (this.table.options.ajaxURL) {
this.setUrl(this.table.options.ajaxURL);
}
if (this.table.options.ajaxProgressiveLoad) {
if (this.table.options.pagination) {
this.progressiveLoad = false;
console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time");
} else {
if (this.table.modExists("page")) {
this.progressiveLoad = this.table.options.ajaxProgressiveLoad;
this.table.modules.page.initializeProgressive(this.progressiveLoad);
} else {
console.error("Pagination plugin is required for progressive ajax loading");
}
}
}
};
Ajax.prototype.createLoaderElement = function () {
var el = document.createElement("div");
el.classList.add("tabulator-loader");
return el;
};
Ajax.prototype.createMsgElement = function () {
var el = document.createElement("div");
el.classList.add("tabulator-loader-msg");
el.setAttribute("role", "alert");
return el;
};
//set ajax params
Ajax.prototype.setParams = function (params, update) {
if (update) {
this.params = this.params || {};
for (var key in params) {
this.params[key] = params[key];
}
} else {
this.params = params;
}
};
Ajax.prototype.getParams = function () {
return this.params || {};
};
//load config object
Ajax.prototype.setConfig = function (config) {
this._loadDefaultConfig();
if (typeof config == "string") {
this.config.method = config;
} else {
for (var key in config) {
this.config[key] = config[key];
}
}
};
//create config object from default
Ajax.prototype._loadDefaultConfig = function (force) {
var self = this;
if (!self.config || force) {
self.config = {};
//load base config from defaults
for (var key in self.defaultConfig) {
self.config[key] = self.defaultConfig[key];
}
}
};
//set request url
Ajax.prototype.setUrl = function (url) {
this.url = url;
};
//get request url
Ajax.prototype.getUrl = function () {
return this.url;
};
//lstandard loading function
Ajax.prototype.loadData = function (inPosition, columnsChanged) {
var self = this;
if (this.progressiveLoad) {
return this._loadDataProgressive();
} else {
return this._loadDataStandard(inPosition, columnsChanged);
}
};
Ajax.prototype.nextPage = function (diff) {
var margin;
if (!this.loading) {
margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.getElement().clientHeight * 2;
if (diff < margin) {
this.table.modules.page.nextPage().then(function () {}).catch(function () {});
}
}
};
Ajax.prototype.blockActiveRequest = function () {
this.requestOrder++;
};
Ajax.prototype._loadDataProgressive = function () {
this.table.rowManager.setData([]);
return this.table.modules.page.setPage(1);
};
Ajax.prototype._loadDataStandard = function (inPosition, columnsChanged) {
var _this = this;
return new Promise(function (resolve, reject) {
_this.sendRequest(inPosition).then(function (data) {
_this.table.rowManager.setData(data, inPosition, columnsChanged).then(function () {
resolve();
}).catch(function (e) {
reject(e);
});
}).catch(function (e) {
reject(e);
});
});
};
Ajax.prototype.generateParamsList = function (data, prefix) {
var self = this,
output = [];
prefix = prefix || "";
if (Array.isArray(data)) {
data.forEach(function (item, i) {
output = output.concat(self.generateParamsList(item, prefix ? prefix + "[" + i + "]" : i));
});
} else if ((typeof data === "undefined" ? "undefined" : _typeof(data)) === "object") {
for (var key in data) {
output = output.concat(self.generateParamsList(data[key], prefix ? prefix + "[" + key + "]" : key));
}
} else {
output.push({ key: prefix, value: data });
}
return output;
};
Ajax.prototype.serializeParams = function (params) {
var output = this.generateParamsList(params),
encoded = [];
output.forEach(function (item) {
encoded.push(encodeURIComponent(item.key) + "=" + encodeURIComponent(item.value));
});
return encoded.join("&");
};
//send ajax request
Ajax.prototype.sendRequest = function (silent) {
var _this2 = this;
var self = this,
url = self.url,
requestNo,
esc,
query;
self.requestOrder++;
requestNo = self.requestOrder;
self._loadDefaultConfig();
return new Promise(function (resolve, reject) {
if (self.table.options.ajaxRequesting.call(_this2.table, self.url, self.params) !== false) {
self.loading = true;
if (!silent) {
self.showLoader();
}
_this2.loaderPromise(url, self.config, self.params).then(function (data) {
if (requestNo === self.requestOrder) {
if (self.table.options.ajaxResponse) {
data = self.table.options.ajaxResponse.call(self.table, self.url, self.params, data);
}
resolve(data);
self.hideLoader();
self.loading = false;
} else {
console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made");
}
}).catch(function (error) {
console.error("Ajax Load Error: ", error);
self.table.options.ajaxError.call(self.table, error);
self.showError();
setTimeout(function () {
self.hideLoader();
}, 3000);
self.loading = false;
reject();
});
} else {
reject();
}
});
};
Ajax.prototype.showLoader = function () {
var shouldLoad = typeof this.table.options.ajaxLoader === "function" ? this.table.options.ajaxLoader() : this.table.options.ajaxLoader;
if (shouldLoad) {
this.hideLoader();
while (this.msgElement.firstChild) {
this.msgElement.removeChild(this.msgElement.firstChild);
}this.msgElement.classList.remove("tabulator-error");
this.msgElement.classList.add("tabulator-loading");
if (this.loadingElement) {
this.msgElement.appendChild(this.loadingElement);
} else {
this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|loading");
}
this.table.element.appendChild(this.loaderElement);
}
};
Ajax.prototype.showError = function () {
this.hideLoader();
while (this.msgElement.firstChild) {
this.msgElement.removeChild(this.msgElement.firstChild);
}this.msgElement.classList.remove("tabulator-loading");
this.msgElement.classList.add("tabulator-error");
if (this.errorElement) {
this.msgElement.appendChild(this.errorElement);
} else {
this.msgElement.innerHTML = this.table.modules.localize.getText("ajax|error");
}
this.table.element.appendChild(this.loaderElement);
};
Ajax.prototype.hideLoader = function () {
if (this.loaderElement.parentNode) {
this.loaderElement.parentNode.removeChild(this.loaderElement);
}
};
//default ajax config object
Ajax.prototype.defaultConfig = {
method: "GET"
};
Ajax.prototype.defaultURLGenerator = function (url, config, params) {
if (url) {
if (params && Object.keys(params).length) {
if (!config.method || config.method.toLowerCase() == "get") {
config.method = "get";
url += (url.includes("?") ? "&" : "?") + this.serializeParams(params);
}
}
}
return url;
};
Ajax.prototype.defaultLoaderPromise = function (url, config, params) {
var self = this,
contentType;
return new Promise(function (resolve, reject) {
//set url
url = self.urlGenerator(url, config, params);
//set body content if not GET request
if (config.method.toUpperCase() != "GET") {
contentType = _typeof(self.table.options.ajaxContentType) === "object" ? self.table.options.ajaxContentType : self.contentTypeFormatters[self.table.options.ajaxContentType];
if (contentType) {
for (var key in contentType.headers) {
if (!config.headers) {
config.headers = {};
}
if (typeof config.headers[key] === "undefined") {
config.headers[key] = contentType.headers[key];
}
}
config.body = contentType.body.call(self, url, config, params);
} else {
console.warn("Ajax Error - Invalid ajaxContentType value:", self.table.options.ajaxContentType);
}
}
if (url) {
//configure headers
if (typeof config.headers === "undefined") {
config.headers = {};
}
if (typeof config.headers.Accept === "undefined") {
config.headers.Accept = "application/json";
}
if (typeof config.headers["X-Requested-With"] === "undefined") {
config.headers["X-Requested-With"] = "XMLHttpRequest";
}
if (typeof config.mode === "undefined") {
config.mode = "cors";
}
if (config.mode == "cors") {
if (typeof config.headers["Access-Control-Allow-Origin"] === "undefined") {
config.headers["Access-Control-Allow-Origin"] = window.location.origin;
}
if (typeof config.credentials === "undefined") {
config.credentials = 'same-origin';
}
} else {
if (typeof config.credentials === "undefined") {
config.credentials = 'include';
}
}
//send request
fetch(url, config).then(function (response) {
if (response.ok) {
response.json().then(function (data) {
resolve(data);
}).catch(function (error) {
reject(error);
console.warn("Ajax Load Error - Invalid JSON returned", error);
});
} else {
console.error("Ajax Load Error - Connection Error: " + response.status, response.statusText);
reject(response);
}
}).catch(function (error) {
console.error("Ajax Load Error - Connection Error: ", error);
reject(error);
});
} else {
console.warn("Ajax Load Error - No URL Set");
resolve([]);
}
});
};
Ajax.prototype.contentTypeFormatters = {
"json": {
headers: {
'Content-Type': 'application/json'
},
body: function body(url, config, params) {
return JSON.stringify(params);
}
},
"form": {
headers: {},
body: function body(url, config, params) {
var output = this.generateParamsList(params),
form = new FormData();
output.forEach(function (item) {
form.append(item.key, item.value);
});
return form;
}
}
};
Tabulator.prototype.registerModule("ajax", Ajax);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="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},Ajax=function(e){this.table=e,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};Ajax.prototype.initialize=function(){var e;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=e.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&("string"==typeof this.table.options.ajaxLoaderError?(e=document.createElement("template"),e.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=e.content.firstChild):this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},Ajax.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},Ajax.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},Ajax.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},Ajax.prototype.getParams=function(){return this.params||{}},Ajax.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},Ajax.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},Ajax.prototype.setUrl=function(e){this.url=e},Ajax.prototype.getUrl=function(){return this.url},Ajax.prototype.loadData=function(e,t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e,t)},Ajax.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,e<t&&this.table.modules.page.nextPage().then(function(){}).catch(function(){}))},Ajax.prototype.blockActiveRequest=function(){this.requestOrder++},Ajax.prototype._loadDataProgressive=function(){return this.table.rowManager.setData([]),this.table.modules.page.setPage(1)},Ajax.prototype._loadDataStandard=function(e,t){var o=this;return new Promise(function(a,r){o.sendRequest(e).then(function(i){o.table.rowManager.setData(i,e,t).then(function(){a()}).catch(function(e){r(e)})}).catch(function(e){r(e)})})},Ajax.prototype.generateParamsList=function(e,t){var o=this,a=[];if(t=t||"",Array.isArray(e))e.forEach(function(e,r){a=a.concat(o.generateParamsList(e,t?t+"["+r+"]":r))});else if("object"===(void 0===e?"undefined":_typeof(e)))for(var r in e)a=a.concat(o.generateParamsList(e[r],t?t+"["+r+"]":r));else a.push({key:t,value:e});return a},Ajax.prototype.serializeParams=function(e){var t=this.generateParamsList(e),o=[];return t.forEach(function(e){o.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))}),o.join("&")},Ajax.prototype.sendRequest=function(e){var t,o=this,a=this,r=a.url;return a.requestOrder++,t=a.requestOrder,a._loadDefaultConfig(),new Promise(function(i,n){!1!==a.table.options.ajaxRequesting.call(o.table,a.url,a.params)?(a.loading=!0,e||a.showLoader(),o.loaderPromise(r,a.config,a.params).then(function(e){t===a.requestOrder?(a.table.options.ajaxResponse&&(e=a.table.options.ajaxResponse.call(a.table,a.url,a.params,e)),i(e),a.hideLoader(),a.loading=!1):console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made")}).catch(function(e){console.error("Ajax Load Error: ",e),a.table.options.ajaxError.call(a.table,e),a.showError(),setTimeout(function(){a.hideLoader()},3e3),a.loading=!1,n()})):n()})},Ajax.prototype.showLoader=function(){iLine truncated
@@ -0,0 +1,495 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ColumnCalcs = function ColumnCalcs(table) {
this.table = table; //hold Tabulator object
this.topCalcs = [];
this.botCalcs = [];
this.genColumn = false;
this.topElement = this.createElement();
this.botElement = this.createElement();
this.topRow = false;
this.botRow = false;
this.topInitialized = false;
this.botInitialized = false;
this.initialize();
};
ColumnCalcs.prototype.createElement = function () {
var el = document.createElement("div");
el.classList.add("tabulator-calcs-holder");
return el;
};
ColumnCalcs.prototype.initialize = function () {
this.genColumn = new Column({ field: "value" }, this);
};
//dummy functions to handle being mock column manager
ColumnCalcs.prototype.registerColumnField = function () {};
//initialize column calcs
ColumnCalcs.prototype.initializeColumn = function (column) {
var def = column.definition;
var config = {
topCalcParams: def.topCalcParams || {},
botCalcParams: def.bottomCalcParams || {}
};
if (def.topCalc) {
switch (_typeof(def.topCalc)) {
case "string":
if (this.calculations[def.topCalc]) {
config.topCalc = this.calculations[def.topCalc];
} else {
console.warn("Column Calc Error - No such calculation found, ignoring: ", def.topCalc);
}
break;
case "function":
config.topCalc = def.topCalc;
break;
}
if (config.topCalc) {
column.modules.columnCalcs = config;
this.topCalcs.push(column);
if (this.table.options.columnCalcs != "group") {
this.initializeTopRow();
}
}
}
if (def.bottomCalc) {
switch (_typeof(def.bottomCalc)) {
case "string":
if (this.calculations[def.bottomCalc]) {
config.botCalc = this.calculations[def.bottomCalc];
} else {
console.warn("Column Calc Error - No such calculation found, ignoring: ", def.bottomCalc);
}
break;
case "function":
config.botCalc = def.bottomCalc;
break;
}
if (config.botCalc) {
column.modules.columnCalcs = config;
this.botCalcs.push(column);
if (this.table.options.columnCalcs != "group") {
this.initializeBottomRow();
}
}
}
};
ColumnCalcs.prototype.removeCalcs = function () {
var changed = false;
if (this.topInitialized) {
this.topInitialized = false;
this.topElement.parentNode.removeChild(this.topElement);
changed = true;
}
if (this.botInitialized) {
this.botInitialized = false;
this.table.footerManager.remove(this.botElement);
changed = true;
}
if (changed) {
this.table.rowManager.adjustTableSize();
}
};
ColumnCalcs.prototype.initializeTopRow = function () {
if (!this.topInitialized) {
// this.table.columnManager.headersElement.after(this.topElement);
this.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);
this.topInitialized = true;
}
};
ColumnCalcs.prototype.initializeBottomRow = function () {
if (!this.botInitialized) {
this.table.footerManager.prepend(this.botElement);
this.botInitialized = true;
}
};
ColumnCalcs.prototype.scrollHorizontal = function (left) {
var hozAdjust = 0,
scrollWidth = this.table.columnManager.getElement().scrollWidth - this.table.element.clientWidth;
if (this.botInitialized) {
this.botRow.getElement().style.marginLeft = -left + "px";
}
};
ColumnCalcs.prototype.recalc = function (rows) {
var data, row;
if (this.topInitialized || this.botInitialized) {
data = this.rowsToData(rows);
if (this.topInitialized) {
if (this.topRow) {
this.topRow.deleteCells();
}
row = this.generateRow("top", this.rowsToData(rows));
this.topRow = row;
while (this.topElement.firstChild) {
this.topElement.removeChild(this.topElement.firstChild);
}this.topElement.appendChild(row.getElement());
row.initialize(true);
}
if (this.botInitialized) {
if (this.botRow) {
this.botRow.deleteCells();
}
row = this.generateRow("bottom", this.rowsToData(rows));
this.botRow = row;
while (this.botElement.firstChild) {
this.botElement.removeChild(this.botElement.firstChild);
}this.botElement.appendChild(row.getElement());
row.initialize(true);
}
this.table.rowManager.adjustTableSize();
//set resizable handles
if (this.table.modExists("frozenColumns")) {
this.table.modules.frozenColumns.layout();
}
}
};
ColumnCalcs.prototype.recalcRowGroup = function (row) {
this.recalcGroup(this.table.modules.groupRows.getRowGroup(row));
};
ColumnCalcs.prototype.recalcAll = function () {
var _this = this;
if (this.topCalcs.length || this.botCalcs.length) {
if (this.table.options.columnCalcs !== "group") {
this.recalc(this.table.rowManager.activeRows);
}
if (this.table.options.groupBy && this.table.options.columnCalcs !== "table") {
var groups = table.modules.groupRows.getChildGroups();
groups.forEach(function (group) {
_this.recalcGroup(group);
});
}
}
};
ColumnCalcs.prototype.recalcGroup = function (group) {
var data, rowData;
if (group) {
if (group.calcs) {
if (group.calcs.bottom) {
data = this.rowsToData(group.rows);
rowData = this.generateRowData("bottom", data);
group.calcs.bottom.updateData(rowData);
group.calcs.bottom.reinitialize();
}
if (group.calcs.top) {
data = this.rowsToData(group.rows);
rowData = this.generateRowData("top", data);
group.calcs.top.updateData(rowData);
group.calcs.top.reinitialize();
}
}
}
};
//generate top stats row
ColumnCalcs.prototype.generateTopRow = function (rows) {
return this.generateRow("top", this.rowsToData(rows));
};
//generate bottom stats row
ColumnCalcs.prototype.generateBottomRow = function (rows) {
return this.generateRow("bottom", this.rowsToData(rows));
};
ColumnCalcs.prototype.rowsToData = function (rows) {
var _this2 = this;
var data = [];
rows.forEach(function (row) {
data.push(row.getData());
if (_this2.table.options.dataTree && _this2.table.options.dataTreeChildColumnCalcs) {
if (row.modules.dataTree.open) {
var children = _this2.rowsToData(_this2.table.modules.dataTree.getFilteredTreeChildren(row));
data = data.concat(children);
}
}
});
return data;
};
//generate stats row
ColumnCalcs.prototype.generateRow = function (pos, data) {
var self = this,
rowData = this.generateRowData(pos, data),
row;
if (self.table.modExists("mutator")) {
self.table.modules.mutator.disable();
}
row = new Row(rowData, this, "calc");
if (self.table.modExists("mutator")) {
self.table.modules.mutator.enable();
}
row.getElement().classList.add("tabulator-calcs", "tabulator-calcs-" + pos);
row.generateCells = function () {
var cells = [];
self.table.columnManager.columnsByIndex.forEach(function (column) {
//set field name of mock column
self.genColumn.setField(column.getField());
self.genColumn.hozAlign = column.hozAlign;
if (column.definition[pos + "CalcFormatter"] && self.table.modExists("format")) {
self.genColumn.modules.format = {
formatter: self.table.modules.format.getFormatter(column.definition[pos + "CalcFormatter"]),
params: column.definition[pos + "CalcFormatterParams"]
};
} else {
self.genColumn.modules.format = {
formatter: self.table.modules.format.getFormatter("plaintext"),
params: {}
};
}
//ensure css class defintion is replicated to calculation cell
self.genColumn.definition.cssClass = column.definition.cssClass;
//generate cell and assign to correct column
var cell = new Cell(self.genColumn, row);
cell.column = column;
cell.setWidth();
column.cells.push(cell);
cells.push(cell);
if (!column.visible) {
cell.hide();
}
});
this.cells = cells;
};
return row;
};
//generate stats row
ColumnCalcs.prototype.generateRowData = function (pos, data) {
var rowData = {},
calcs = pos == "top" ? this.topCalcs : this.botCalcs,
type = pos == "top" ? "topCalc" : "botCalc",
params,
paramKey;
calcs.forEach(function (column) {
var values = [];
if (column.modules.columnCalcs && column.modules.columnCalcs[type]) {
data.forEach(function (item) {
values.push(column.getFieldValue(item));
});
paramKey = type + "Params";
params = typeof column.modules.columnCalcs[paramKey] === "function" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];
column.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));
}
});
return rowData;
};
ColumnCalcs.prototype.hasTopCalcs = function () {
return !!this.topCalcs.length;
};
ColumnCalcs.prototype.hasBottomCalcs = function () {
return !!this.botCalcs.length;
};
//handle table redraw
ColumnCalcs.prototype.redraw = function () {
if (this.topRow) {
this.topRow.normalizeHeight(true);
}
if (this.botRow) {
this.botRow.normalizeHeight(true);
}
};
//return the calculated
ColumnCalcs.prototype.getResults = function () {
var self = this,
results = {},
groups;
if (this.table.options.groupBy && this.table.modExists("groupRows")) {
groups = this.table.modules.groupRows.getGroups(true);
groups.forEach(function (group) {
results[group.getKey()] = self.getGroupResults(group);
});
} else {
results = {
top: this.topRow ? this.topRow.getData() : {},
bottom: this.botRow ? this.botRow.getData() : {}
};
}
return results;
};
//get results from a group
ColumnCalcs.prototype.getGroupResults = function (group) {
var self = this,
groupObj = group._getSelf(),
subGroups = group.getSubGroups(),
subGroupResults = {},
results = {};
subGroups.forEach(function (subgroup) {
subGroupResults[subgroup.getKey()] = self.getGroupResults(subgroup);
});
results = {
top: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},
bottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},
groups: subGroupResults
};
return results;
};
//default calculations
ColumnCalcs.prototype.calculations = {
"avg": function avg(values, data, calcParams) {
var output = 0,
precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : 2;
if (values.length) {
output = values.reduce(function (sum, value) {
value = Number(value);
return sum + value;
});
output = output / values.length;
output = precision !== false ? output.toFixed(precision) : output;
}
return parseFloat(output).toString();
},
"max": function max(values, data, calcParams) {
var output = null,
precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false;
values.forEach(function (value) {
value = Number(value);
if (value > output || output === null) {
output = value;
}
});
return output !== null ? precision !== false ? output.toFixed(precision) : output : "";
},
"min": function min(values, data, calcParams) {
var output = null,
precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false;
values.forEach(function (value) {
value = Number(value);
if (value < output || output === null) {
output = value;
}
});
return output !== null ? precision !== false ? output.toFixed(precision) : output : "";
},
"sum": function sum(values, data, calcParams) {
var output = 0,
precision = typeof calcParams.precision !== "undefined" ? calcParams.precision : false;
if (values.length) {
values.forEach(function (value) {
value = Number(value);
output += !isNaN(value) ? Number(value) : 0;
});
}
return precision !== false ? output.toFixed(precision) : output;
},
"concat": function concat(values, data, calcParams) {
var output = 0;
if (values.length) {
output = values.reduce(function (sum, value) {
return String(sum) + String(value);
});
}
return output;
},
"count": function count(values, data, calcParams) {
var output = 0;
if (values.length) {
values.forEach(function (value) {
if (value) {
output++;
}
});
}
return output;
}
};
Tabulator.prototype.registerModule("columnCalcs", ColumnCalcs);
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ColumnCalcs=function(t){this.table=t,this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};ColumnCalcs.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t},ColumnCalcs.prototype.initialize=function(){this.genColumn=new Column({field:"value"},this)},ColumnCalcs.prototype.registerColumnField=function(){},ColumnCalcs.prototype.initializeColumn=function(t){var o=t.definition,e={topCalcParams:o.topCalcParams||{},botCalcParams:o.bottomCalcParams||{}};if(o.topCalc){switch(_typeof(o.topCalc)){case"string":this.calculations[o.topCalc]?e.topCalc=this.calculations[o.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.topCalc);break;case"function":e.topCalc=o.topCalc}e.topCalc&&(t.modules.columnCalcs=e,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(o.bottomCalc){switch(_typeof(o.bottomCalc)){case"string":this.calculations[o.bottomCalc]?e.botCalc=this.calculations[o.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.bottomCalc);break;case"function":e.botCalc=o.bottomCalc}e.botCalc&&(t.modules.columnCalcs=e,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}},ColumnCalcs.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()},ColumnCalcs.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)},ColumnCalcs.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)},ColumnCalcs.prototype.scrollHorizontal=function(t){this.table.columnManager.getElement().scrollWidth,this.table.element.clientWidth;this.botInitialized&&(this.botRow.getElement().style.marginLeft=-t+"px")},ColumnCalcs.prototype.recalc=function(t){var o;if(this.topInitialized||this.botInitialized){if(this.rowsToData(t),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),o=this.generateRow("top",this.rowsToData(t)),this.topRow=o;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(o.getElement()),o.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),o=this.generateRow("bottom",this.rowsToData(t)),this.botRow=o;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(o.getElement()),o.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}},ColumnCalcs.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))},ColumnCalcs.prototype.recalcAll=function(){var t=this;if((this.topCalcs.length||this.botCalcs.length)&&("group"!==this.table.options.columnCalcs&&this.recalc(this.table.rowManager.activeRows),this.table.options.groupBy&&"table"!==this.table.options.columnCalcs)){table.modules.groupRows.getChildGroups().forEach(function(o){t.recalcGroup(o)})}},ColumnCalcs.prototype.recalcGroup=function(t){var o,e;t&&t.calcs&&(t.calcs.bottom&&(o=this.rowsToData(t.rows),e=this.generateRowData("bottom",o),t.calcs.bottom.updateData(e),t.calcs.bottom.reinitialize()),t.calcs.top&&(o=this.rowsToData(t.rows),e=this.generateRowData("top",o),t.calcs.top.updateData(e),t.calcs.top.reinitialize()))},ColumnCalcs.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))},ColumnCalcs.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))},ColumnCalcs.prototype.rowsToData=function(t){var o=this,e=[];return t.forEach(function(t){if(e.push(t.getData()),o.table.options.dataTree&&o.table.options.dataTreeChildColumnCalcs&&t.modules.dataTree.open){var l=o.rowsToData(o.table.modules.dataTree.getFilteredTreeChildren(t));e=e.concat(l)}}),e},ColumnCalcs.prototype.generateRow=function(t,o){var e,l=this,i=this.generateRowData(t,o);return l.table.modExists("mutator")&&l.table.modules.mutator.disable(),e=new Row(i,this,"calc"),l.table.modExists("mutator")&&l.table.modules.mutator.enable(),e.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),e.generateCells=function(){var o=[];l.table.columnManager.columnsBLine truncated
@@ -0,0 +1,335 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Clipboard = function Clipboard(table) {
this.table = table;
this.mode = true;
this.pasteParser = function () {};
this.pasteAction = function () {};
this.customSelection = false;
this.rowRange = false;
this.blocked = true; //block copy actions not originating from this command
};
Clipboard.prototype.initialize = function () {
var _this = this;
this.mode = this.table.options.clipboard;
this.rowRange = this.table.options.clipboardCopyRowRange;
if (this.mode === true || this.mode === "copy") {
this.table.element.addEventListener("copy", function (e) {
var plain, html;
if (!_this.blocked) {
e.preventDefault();
if (_this.customSelection) {
plain = _this.customSelection;
if (_this.table.options.clipboardCopyFormatter) {
plain = _this.table.options.clipboardCopyFormatter("plain", plain);
}
} else {
html = _this.table.modules.export.getHtml(_this.rowRange, _this.table.options.clipboardCopyStyled, _this.table.options.clipboardCopyConfig, "clipboard");
plain = html ? _this.generatePlainContent(html) : "";
if (_this.table.options.clipboardCopyFormatter) {
plain = _this.table.options.clipboardCopyFormatter("plain", plain);
html = _this.table.options.clipboardCopyFormatter("html", html);
}
}
if (window.clipboardData && window.clipboardData.setData) {
window.clipboardData.setData('Text', plain);
} else if (e.clipboardData && e.clipboardData.setData) {
e.clipboardData.setData('text/plain', plain);
if (html) {
e.clipboardData.setData('text/html', html);
}
} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {
e.originalEvent.clipboardData.setData('text/plain', plain);
if (html) {
e.originalEvent.clipboardData.setData('text/html', html);
}
}
_this.table.options.clipboardCopied.call(_this.table, plain, html);
_this.reset();
}
});
}
if (this.mode === true || this.mode === "paste") {
this.table.element.addEventListener("paste", function (e) {
_this.paste(e);
});
}
this.setPasteParser(this.table.options.clipboardPasteParser);
this.setPasteAction(this.table.options.clipboardPasteAction);
};
Clipboard.prototype.reset = function () {
this.blocked = false;
this.originalSelectionText = "";
};
Clipboard.prototype.generatePlainContent = function (html) {
var output = [];
var holder = document.createElement("div");
holder.innerHTML = html;
var table = holder.getElementsByTagName("table")[0];
var rows = Array.prototype.slice.call(table.getElementsByTagName("tr"));
rows.forEach(function (row) {
var rowData = [];
var headers = Array.prototype.slice.call(row.getElementsByTagName("th"));
var cells = Array.prototype.slice.call(row.getElementsByTagName("td"));
cells = cells.concat(headers);
cells.forEach(function (cell) {
var val = cell.innerHTML;
val = val == "&nbsp;" ? "" : val;
rowData.push(val);
});
output.push(rowData.join("\t"));
});
return output.join("\n");
};
Clipboard.prototype.copy = function (range, internal) {
var range, sel, textRange;
this.blocked = false;
this.customSelection = false;
if (this.mode === true || this.mode === "copy") {
this.rowRange = range || this.table.options.clipboardCopyRowRange;
if (typeof window.getSelection != "undefined" && typeof document.createRange != "undefined") {
range = document.createRange();
range.selectNodeContents(this.table.element);
sel = window.getSelection();
if (sel.toString() && internal) {
this.customSelection = sel.toString();
}
sel.removeAllRanges();
sel.addRange(range);
} else if (typeof document.selection != "undefined" && typeof document.body.createTextRange != "undefined") {
textRange = document.body.createTextRange();
textRange.moveToElementText(this.table.element);
textRange.select();
}
document.execCommand('copy');
if (sel) {
sel.removeAllRanges();
}
}
};
//PASTE EVENT HANDLING
Clipboard.prototype.setPasteAction = function (action) {
switch (typeof action === "undefined" ? "undefined" : _typeof(action)) {
case "string":
this.pasteAction = this.pasteActions[action];
if (!this.pasteAction) {
console.warn("Clipboard Error - No such paste action found:", action);
}
break;
case "function":
this.pasteAction = action;
break;
}
};
Clipboard.prototype.setPasteParser = function (parser) {
switch (typeof parser === "undefined" ? "undefined" : _typeof(parser)) {
case "string":
this.pasteParser = this.pasteParsers[parser];
if (!this.pasteParser) {
console.warn("Clipboard Error - No such paste parser found:", parser);
}
break;
case "function":
this.pasteParser = parser;
break;
}
};
Clipboard.prototype.paste = function (e) {
var data, rowData, rows;
if (this.checkPaseOrigin(e)) {
data = this.getPasteData(e);
rowData = this.pasteParser.call(this, data);
if (rowData) {
e.preventDefault();
if (this.table.modExists("mutator")) {
rowData = this.mutateData(rowData);
}
rows = this.pasteAction.call(this, rowData);
this.table.options.clipboardPasted.call(this.table, data, rowData, rows);
} else {
this.table.options.clipboardPasteError.call(this.table, data);
}
}
};
Clipboard.prototype.mutateData = function (data) {
var self = this,
output = [];
if (Array.isArray(data)) {
data.forEach(function (row) {
output.push(self.table.modules.mutator.transformRow(row, "clipboard"));
});
} else {
output = data;
}
return output;
};
Clipboard.prototype.checkPaseOrigin = function (e) {
var valid = true;
if (e.target.tagName != "DIV" || this.table.modules.edit.currentCell) {
valid = false;
}
return valid;
};
Clipboard.prototype.getPasteData = function (e) {
var data;
if (window.clipboardData && window.clipboardData.getData) {
data = window.clipboardData.getData('Text');
} else if (e.clipboardData && e.clipboardData.getData) {
data = e.clipboardData.getData('text/plain');
} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {
data = e.originalEvent.clipboardData.getData('text/plain');
}
return data;
};
Clipboard.prototype.pasteParsers = {
table: function table(clipboard) {
var data = [],
success = false,
headerFindSuccess = true,
columns = this.table.columnManager.columns,
columnMap = [],
rows = [];
//get data from clipboard into array of columns and rows.
clipboard = clipboard.split("\n");
clipboard.forEach(function (row) {
data.push(row.split("\t"));
});
if (data.length && !(data.length === 1 && data[0].length < 2)) {
success = true;
//check if headers are present by title
data[0].forEach(function (value) {
var column = columns.find(function (column) {
return value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();
});
if (column) {
columnMap.push(column);
} else {
headerFindSuccess = false;
}
});
//check if column headers are present by field
if (!headerFindSuccess) {
headerFindSuccess = true;
columnMap = [];
data[0].forEach(function (value) {
var column = columns.find(function (column) {
return value && column.field && value.trim() && column.field.trim() === value.trim();
});
if (column) {
columnMap.push(column);
} else {
headerFindSuccess = false;
}
});
if (!headerFindSuccess) {
columnMap = this.table.columnManager.columnsByIndex;
}
}
//remove header row if found
if (headerFindSuccess) {
data.shift();
}
data.forEach(function (item) {
var row = {};
item.forEach(function (value, i) {
if (columnMap[i]) {
row[columnMap[i].field] = value;
}
});
rows.push(row);
});
return rows;
} else {
return false;
}
}
};
Clipboard.prototype.pasteActions = {
replace: function replace(rows) {
return this.table.setData(rows);
},
update: function update(rows) {
return this.table.updateOrAddData(rows);
},
insert: function insert(rows) {
return this.table.addData(rows);
}
};
Tabulator.prototype.registerModule("clipboard", Clipboard);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Clipboard=function(t){this.table=t,this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0};Clipboard.prototype.initialize=function(){var t=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(e){var a,o;t.blocked||(e.preventDefault(),t.customSelection?(a=t.customSelection,t.table.options.clipboardCopyFormatter&&(a=t.table.options.clipboardCopyFormatter("plain",a))):(o=t.table.modules.export.getHtml(t.rowRange,t.table.options.clipboardCopyStyled,t.table.options.clipboardCopyConfig,"clipboard"),a=o?t.generatePlainContent(o):"",t.table.options.clipboardCopyFormatter&&(a=t.table.options.clipboardCopyFormatter("plain",a),o=t.table.options.clipboardCopyFormatter("html",o))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",a):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",a),o&&e.clipboardData.setData("text/html",o)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",a),o&&e.originalEvent.clipboardData.setData("text/html",o)),t.table.options.clipboardCopied.call(t.table,a,o),t.reset())}),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",function(e){t.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction)},Clipboard.prototype.reset=function(){this.blocked=!1,this.originalSelectionText=""},Clipboard.prototype.generatePlainContent=function(t){var e=[],a=document.createElement("div");a.innerHTML=t;var o=a.getElementsByTagName("table")[0];return Array.prototype.slice.call(o.getElementsByTagName("tr")).forEach(function(t){var a=[],o=Array.prototype.slice.call(t.getElementsByTagName("th")),i=Array.prototype.slice.call(t.getElementsByTagName("td"));i=i.concat(o),i.forEach(function(t){var e=t.innerHTML;e="&nbsp;"==e?"":e,a.push(e)}),e.push(a.join("\t"))}),e.join("\n")},Clipboard.prototype.copy=function(t,e){var t,a,o;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=t||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?(t=document.createRange(),t.selectNodeContents(this.table.element),a=window.getSelection(),a.toString()&&e&&(this.customSelection=a.toString()),a.removeAllRanges(),a.addRange(t)):void 0!==document.selection&&void 0!==document.body.createTextRange&&(o=document.body.createTextRange(),o.moveToElementText(this.table.element),o.select()),document.execCommand("copy"),a&&a.removeAllRanges())},Clipboard.prototype.setPasteAction=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":this.pasteAction=this.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}},Clipboard.prototype.setPasteParser=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":this.pasteParser=this.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}},Clipboard.prototype.paste=function(t){var e,a,o;this.checkPaseOrigin(t)&&(e=this.getPasteData(t),a=this.pasteParser.call(this,e),a?(t.preventDefault(),this.table.modExists("mutator")&&(a=this.mutateData(a)),o=this.pasteAction.call(this,a),this.table.options.clipboardPasted.call(this.table,e,a,o)):this.table.options.clipboardPasteError.call(this.table,e))},Clipboard.prototype.mutateData=function(t){var e=this,a=[];return Array.isArray(t)?t.forEach(function(t){a.push(e.table.modules.mutator.transformRow(t,"clipboard"))}):a=t,a},Clipboard.prototype.checkPaseOrigin=function(t){var e=!0;return("DIV"!=t.target.tagName||this.table.modules.edit.currentCell)&&(e=!1),e},Clipboard.prototype.getPasteData=function(t){var e;return window.clipboardData&&window.clipboardData.getData?e=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?e=t.clipboardData.getData("text/plain"):t.originalEvent&&t.originalEvent.clipboardData.getData&&(e=t.originalEvent.clipboardData.getData("text/plain")),e},Clipboard.prototype.pasteParsers={table:function(t){var e=[],a=!0,o=this.table.columnManager.columns,i=[],n=[];return t=t.split("\n"),t.forEach(function(t){e.push(t.split("\t"))}),!(!e.length||1===e.length&&e[0].length<2)&&(!0,e[0].forEach(function(t){var e=o.find(function(e){return t&&e.definition.title&&t.trim()&&e.definition.title.trim()===t.trim()});e?i.push(e):a=!1}),a||(a=!0,i=[],e[0].forEach(function(t){var e=o.find(function(e){return t&&e.field&&t.trim()&&e.field.trim()==Line truncated
@@ -0,0 +1,386 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var DataTree = function DataTree(table) {
this.table = table;
this.indent = 10;
this.field = "";
this.collapseEl = null;
this.expandEl = null;
this.branchEl = null;
this.elementField = false;
this.startOpen = function () {};
this.displayIndex = 0;
};
DataTree.prototype.initialize = function () {
var dummyEl = null,
firstCol = this.table.columnManager.getFirstVisibileColumn(),
options = this.table.options;
this.field = options.dataTreeChildField;
this.indent = options.dataTreeChildIndent;
this.elementField = options.dataTreeElementColumn || (firstCol ? firstCol.field : false);
if (options.dataTreeBranchElement) {
if (options.dataTreeBranchElement === true) {
this.branchEl = document.createElement("div");
this.branchEl.classList.add("tabulator-data-tree-branch");
} else {
if (typeof options.dataTreeBranchElement === "string") {
dummyEl = document.createElement("div");
dummyEl.innerHTML = options.dataTreeBranchElement;
this.branchEl = dummyEl.firstChild;
} else {
this.branchEl = options.dataTreeBranchElement;
}
}
}
if (options.dataTreeCollapseElement) {
if (typeof options.dataTreeCollapseElement === "string") {
dummyEl = document.createElement("div");
dummyEl.innerHTML = options.dataTreeCollapseElement;
this.collapseEl = dummyEl.firstChild;
} else {
this.collapseEl = options.dataTreeCollapseElement;
}
} else {
this.collapseEl = document.createElement("div");
this.collapseEl.classList.add("tabulator-data-tree-control");
this.collapseEl.tabIndex = 0;
this.collapseEl.innerHTML = "<div class='tabulator-data-tree-control-collapse'></div>";
}
if (options.dataTreeExpandElement) {
if (typeof options.dataTreeExpandElement === "string") {
dummyEl = document.createElement("div");
dummyEl.innerHTML = options.dataTreeExpandElement;
this.expandEl = dummyEl.firstChild;
} else {
this.expandEl = options.dataTreeExpandElement;
}
} else {
this.expandEl = document.createElement("div");
this.expandEl.classList.add("tabulator-data-tree-control");
this.expandEl.tabIndex = 0;
this.expandEl.innerHTML = "<div class='tabulator-data-tree-control-expand'></div>";
}
switch (_typeof(options.dataTreeStartExpanded)) {
case "boolean":
this.startOpen = function (row, index) {
return options.dataTreeStartExpanded;
};
break;
case "function":
this.startOpen = options.dataTreeStartExpanded;
break;
default:
this.startOpen = function (row, index) {
return options.dataTreeStartExpanded[index];
};
break;
}
};
DataTree.prototype.initializeRow = function (row) {
var childArray = row.getData()[this.field];
var isArray = Array.isArray(childArray);
var children = isArray || !isArray && (typeof childArray === "undefined" ? "undefined" : _typeof(childArray)) === "object" && childArray !== null;
if (!children && row.modules.dataTree && row.modules.dataTree.branchEl) {
row.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);
}
if (!children && row.modules.dataTree && row.modules.dataTree.controlEl) {
row.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);
}
row.modules.dataTree = {
index: row.modules.dataTree ? row.modules.dataTree.index : 0,
open: children ? row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0) : false,
controlEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,
branchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,
parent: row.modules.dataTree ? row.modules.dataTree.parent : false,
children: children
};
};
DataTree.prototype.layoutRow = function (row) {
var cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],
el = cell.getElement(),
config = row.modules.dataTree;
if (config.branchEl) {
if (config.branchEl.parentNode) {
config.branchEl.parentNode.removeChild(config.branchEl);
}
config.branchEl = false;
}
if (config.controlEl) {
if (config.controlEl.parentNode) {
config.controlEl.parentNode.removeChild(config.controlEl);
}
config.controlEl = false;
}
this.generateControlElement(row, el);
row.element.classList.add("tabulator-tree-level-" + config.index);
if (config.index) {
if (this.branchEl) {
config.branchEl = this.branchEl.cloneNode(true);
el.insertBefore(config.branchEl, el.firstChild);
config.branchEl.style.marginLeft = (config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1) + config.index * this.indent + "px";
} else {
el.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + config.index * this.indent + "px";
}
}
};
DataTree.prototype.generateControlElement = function (row, el) {
var _this = this;
var config = row.modules.dataTree,
el = el || row.getCells()[0].getElement(),
oldControl = config.controlEl;
if (config.children !== false) {
if (config.open) {
config.controlEl = this.collapseEl.cloneNode(true);
config.controlEl.addEventListener("click", function (e) {
e.stopPropagation();
_this.collapseRow(row);
});
} else {
config.controlEl = this.expandEl.cloneNode(true);
config.controlEl.addEventListener("click", function (e) {
e.stopPropagation();
_this.expandRow(row);
});
}
config.controlEl.addEventListener("mousedown", function (e) {
e.stopPropagation();
});
if (oldControl && oldControl.parentNode === el) {
oldControl.parentNode.replaceChild(config.controlEl, oldControl);
} else {
el.insertBefore(config.controlEl, el.firstChild);
}
}
};
DataTree.prototype.setDisplayIndex = function (index) {
this.displayIndex = index;
};
DataTree.prototype.getDisplayIndex = function () {
return this.displayIndex;
};
DataTree.prototype.getRows = function (rows) {
var _this2 = this;
var output = [];
rows.forEach(function (row, i) {
var config, children;
output.push(row);
if (row instanceof Row) {
config = row.modules.dataTree.children;
if (!config.index && config.children !== false) {
children = _this2.getChildren(row);
children.forEach(function (child) {
output.push(child);
});
}
}
});
return output;
};
DataTree.prototype.getChildren = function (row) {
var _this3 = this;
var config = row.modules.dataTree,
children = [],
output = [];
if (config.children !== false && config.open) {
if (!Array.isArray(config.children)) {
config.children = this.generateChildren(row);
}
if (this.table.modExists("filter")) {
children = this.table.modules.filter.filter(config.children);
} else {
children = config.children;
}
if (this.table.modExists("sort")) {
this.table.modules.sort.sort(children);
}
children.forEach(function (child) {
output.push(child);
var subChildren = _this3.getChildren(child);
subChildren.forEach(function (sub) {
output.push(sub);
});
});
}
return output;
};
DataTree.prototype.generateChildren = function (row) {
var _this4 = this;
var children = [];
var childArray = row.getData()[this.field];
if (!Array.isArray(childArray)) {
childArray = [childArray];
}
childArray.forEach(function (childData) {
var childRow = new Row(childData || {}, _this4.table.rowManager);
childRow.modules.dataTree.index = row.modules.dataTree.index + 1;
childRow.modules.dataTree.parent = row;
if (childRow.modules.dataTree.children) {
childRow.modules.dataTree.open = _this4.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);
}
children.push(childRow);
});
return children;
};
DataTree.prototype.expandRow = function (row, silent) {
var config = row.modules.dataTree;
if (config.children !== false) {
config.open = true;
row.reinitialize();
this.table.rowManager.refreshActiveData("tree", false, true);
this.table.options.dataTreeRowExpanded(row.getComponent(), row.modules.dataTree.index);
}
};
DataTree.prototype.collapseRow = function (row) {
var config = row.modules.dataTree;
if (config.children !== false) {
config.open = false;
row.reinitialize();
this.table.rowManager.refreshActiveData("tree", false, true);
this.table.options.dataTreeRowCollapsed(row.getComponent(), row.modules.dataTree.index);
}
};
DataTree.prototype.toggleRow = function (row) {
var config = row.modules.dataTree;
if (config.children !== false) {
if (config.open) {
this.collapseRow(row);
} else {
this.expandRow(row);
}
}
};
DataTree.prototype.getTreeParent = function (row) {
return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;
};
DataTree.prototype.getFilteredTreeChildren = function (row) {
var config = row.modules.dataTree,
output = [],
children;
if (config.children) {
if (!Array.isArray(config.children)) {
config.children = this.generateChildren(row);
}
if (this.table.modExists("filter")) {
children = this.table.modules.filter.filter(config.children);
} else {
children = config.children;
}
children.forEach(function (childRow) {
if (childRow instanceof Row) {
output.push(childRow);
}
});
}
return output;
};
DataTree.prototype.getTreeChildren = function (row) {
var config = row.modules.dataTree,
output = [];
if (config.children) {
if (!Array.isArray(config.children)) {
config.children = this.generateChildren(row);
}
config.children.forEach(function (childRow) {
if (childRow instanceof Row) {
output.push(childRow.getComponent());
}
});
}
return output;
};
DataTree.prototype.checkForRestyle = function (cell) {
if (!cell.row.cells.indexOf(cell)) {
cell.row.reinitialize();
}
};
DataTree.prototype.getChildField = function () {
return this.field;
};
DataTree.prototype.redrawNeeded = function (data) {
return (this.field ? typeof data[this.field] !== "undefined" : false) || (this.elementField ? typeof data[this.elementField] !== "undefined" : false);
};
Tabulator.prototype.registerModule("dataTree", DataTree);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="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},DataTree=function(e){this.table=e,this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.displayIndex=0};DataTree.prototype.initialize=function(){var e=null,t=this.table.columnManager.getFirstVisibileColumn(),a=this.table.options;switch(this.field=a.dataTreeChildField,this.indent=a.dataTreeChildIndent,this.elementField=a.dataTreeElementColumn||!!t&&t.field,a.dataTreeBranchElement&&(!0===a.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof a.dataTreeBranchElement?(e=document.createElement("div"),e.innerHTML=a.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=a.dataTreeBranchElement),a.dataTreeCollapseElement?"string"==typeof a.dataTreeCollapseElement?(e=document.createElement("div"),e.innerHTML=a.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=a.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),a.dataTreeExpandElement?"string"==typeof a.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=a.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=a.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),_typeof(a.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return a.dataTreeStartExpanded};break;case"function":this.startOpen=a.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return a.dataTreeStartExpanded[t]}}},DataTree.prototype.initializeRow=function(e){var t=e.getData()[this.field],a=Array.isArray(t),r=a||!a&&"object"===(void 0===t?"undefined":_typeof(t))&&null!==t;!r&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!r&&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:!!r&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!r)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!r)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:r}},DataTree.prototype.layoutRow=function(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],a=t.getElement(),r=e.modules.dataTree;r.branchEl&&(r.branchEl.parentNode&&r.branchEl.parentNode.removeChild(r.branchEl),r.branchEl=!1),r.controlEl&&(r.controlEl.parentNode&&r.controlEl.parentNode.removeChild(r.controlEl),r.controlEl=!1),this.generateControlElement(e,a),e.element.classList.add("tabulator-tree-level-"+r.index),r.index&&(this.branchEl?(r.branchEl=this.branchEl.cloneNode(!0),a.insertBefore(r.branchEl,a.firstChild),r.branchEl.style.marginLeft=(r.branchEl.offsetWidth+r.branchEl.style.marginRight)*(r.index-1)+r.index*this.indent+"px"):a.style.paddingLeft=parseInt(window.getComputedStyle(a,null).getPropertyValue("padding-left"))+r.index*this.indent+"px")},DataTree.prototype.generateControlElement=function(e,t){var a=this,r=e.modules.dataTree,t=t||e.getCells()[0].getElement(),n=r.controlEl;!1!==r.children&&(r.open?(r.controlEl=this.collapseEl.cloneNode(!0),r.controlEl.addEventListener("click",function(t){t.stopPropagation(),a.collapseRow(e)})):(r.controlEl=this.expandEl.cloneNode(!0),r.controlEl.addEventListener("click",function(t){t.stopPropagation(),a.expandRow(e)})),r.controlEl.addEventListener("mousedown",function(e){e.stopPropagation()}),n&&n.parentNode===t?n.parentNode.replaceChild(r.controlEl,n):t.insertBefore(r.controlEl,t.firstChild))},DataTree.prototype.setDisplayIndex=function(e){this.displayIndex=e},DataTree.prototype.getDisplayIndex=function(){return this.displayIndex},DataTree.prototype.getRows=function(e){var t=this,a=[];return e.forEach(function(e,r){var n,l;a.push(e),e instanceof Row&&(n=e.modules.dataTree.children,n.index||!1===n.children||(l=t.getChildren(e),l.forEach(function(e){a.push(e)})))}),a},DataTree.prototype.getChildren=function(e){var t=this,a=e.modules.dataTree,r=[],n=[];return!1!==a.children&&a.open&&(Array.isArray(a.children)||(a.children=this.generateChildren(e)),r=this.table.modExists("filter")?this.table.modules.filter.filter(a.children):a.children,this.table.modExists("sort")&&this.table.modules.sort.sort(r),r.forEach(function(e){nLine truncated
@@ -0,0 +1,949 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Download = function Download(table) {
this.table = table; //hold Tabulator object
this.fields = {}; //hold filed multi dimension arrays
this.columnsByIndex = []; //hold columns in their order in the table
this.columnsByField = {}; //hold columns with lookup by field name
this.config = {};
this.active = false;
};
//trigger file download
Download.prototype.download = function (type, filename, options, active, interceptCallback) {
var self = this,
downloadFunc = false;
this.processConfig();
this.active = active;
function buildLink(data, mime) {
if (interceptCallback) {
if (interceptCallback === true) {
self.triggerDownload(data, mime, type, filename, true);
} else {
interceptCallback(data);
}
} else {
self.triggerDownload(data, mime, type, filename);
}
}
if (typeof type == "function") {
downloadFunc = type;
} else {
if (self.downloaders[type]) {
downloadFunc = self.downloaders[type];
} else {
console.warn("Download Error - No such download type found: ", type);
}
}
this.processColumns();
if (downloadFunc) {
downloadFunc.call(this, self.processDefinitions(), self.processData(active || "active"), options || {}, buildLink, this.config);
}
};
Download.prototype.processConfig = function () {
var config = { //download config
columnGroups: true,
rowGroups: true,
columnCalcs: true,
dataTree: true
};
if (this.table.options.downloadConfig) {
for (var key in this.table.options.downloadConfig) {
config[key] = this.table.options.downloadConfig[key];
}
}
this.config.rowGroups = config.rowGroups && this.table.options.groupBy && this.table.modExists("groupRows");
if (config.columnGroups && this.table.columnManager.columns.length != this.table.columnManager.columnsByIndex.length) {
this.config.columnGroups = true;
}
if (config.columnCalcs && this.table.modExists("columnCalcs")) {
this.config.columnCalcs = true;
}
if (config.dataTree && this.table.options.dataTree && this.table.modExists("dataTree")) {
this.config.dataTree = true;
}
};
Download.prototype.processColumns = function () {
var self = this;
self.columnsByIndex = [];
self.columnsByField = {};
self.table.columnManager.columnsByIndex.forEach(function (column) {
if (column.field && column.definition.download !== false && (column.visible || !column.visible && column.definition.download)) {
self.columnsByIndex.push(column);
self.columnsByField[column.field] = column;
}
});
};
Download.prototype.processDefinitions = function () {
var self = this,
processedDefinitions = [];
if (this.config.columnGroups) {
self.table.columnManager.columns.forEach(function (column) {
var colData = self.processColumnGroup(column);
if (colData) {
processedDefinitions.push(colData);
}
});
} else {
self.columnsByIndex.forEach(function (column) {
if (column.download !== false) {
//isolate definiton from defintion object
processedDefinitions.push(self.processDefinition(column));
}
});
}
return processedDefinitions;
};
Download.prototype.processColumnGroup = function (column) {
var _this = this;
var subGroups = column.columns,
maxDepth = 0;
var processedColumn = this.processDefinition(column);
var groupData = {
type: "group",
title: processedColumn.title,
depth: 1
};
if (subGroups.length) {
groupData.subGroups = [];
groupData.width = 0;
subGroups.forEach(function (subGroup) {
var subGroupData = _this.processColumnGroup(subGroup);
if (subGroupData.depth > maxDepth) {
maxDepth = subGroupData.depth;
}
if (subGroupData) {
groupData.width += subGroupData.width;
groupData.subGroups.push(subGroupData);
}
});
groupData.depth += maxDepth;
if (!groupData.width) {
return false;
}
} else {
if (column.field && column.definition.download !== false && (column.visible || !column.visible && column.definition.download)) {
groupData.width = 1;
groupData.definition = processedColumn;
} else {
return false;
}
}
return groupData;
};
Download.prototype.processDefinition = function (column) {
var def = {};
for (var key in column.definition) {
def[key] = column.definition[key];
}
if (typeof column.definition.downloadTitle != "undefined") {
def.title = column.definition.downloadTitle;
}
return def;
};
Download.prototype.processData = function (active) {
var _this2 = this;
var self = this,
data = [],
groups = [],
rows = false,
calcs = {};
if (this.config.rowGroups) {
if (active == "visible") {
rows = self.table.rowManager.getRows(active);
rows.forEach(function (row) {
if (row.type == "row") {
var group = row.getGroup();
if (groups.indexOf(group) === -1) {
groups.push(group);
}
}
});
} else {
groups = this.table.modules.groupRows.getGroups();
}
groups.forEach(function (group) {
data.push(_this2.processGroupData(group, rows));
});
} else {
if (this.config.dataTree) {
active = active = "active" ? "display" : active;
}
data = self.table.rowManager.getData(active, "download");
}
if (this.config.columnCalcs) {
calcs = this.table.getCalcResults();
data = {
calcs: calcs,
data: data
};
}
//bulk data processing
if (typeof self.table.options.downloadDataFormatter == "function") {
data = self.table.options.downloadDataFormatter(data);
}
return data;
};
Download.prototype.processGroupData = function (group, visRows) {
var _this3 = this;
var subGroups = group.getSubGroups();
var groupData = {
type: "group",
key: group.key
};
if (subGroups.length) {
groupData.subGroups = [];
subGroups.forEach(function (subGroup) {
groupData.subGroups.push(_this3.processGroupData(subGroup, visRows));
});
} else {
if (visRows) {
groupData.rows = [];
group.rows.forEach(function (row) {
if (visRows.indexOf(row) > -1) {
groupData.rows.push(row.getData("download"));
}
});
} else {
groupData.rows = group.getData(true, "download");
}
}
return groupData;
};
Download.prototype.triggerDownload = function (data, mime, type, filename, newTab) {
var element = document.createElement('a'),
blob = new Blob([data], { type: mime }),
filename = filename || "Tabulator." + (typeof type === "function" ? "txt" : type);
blob = this.table.options.downloadReady.call(this.table, data, blob);
if (blob) {
if (newTab) {
window.open(window.URL.createObjectURL(blob));
} else {
if (navigator.msSaveOrOpenBlob) {
navigator.msSaveOrOpenBlob(blob, filename);
} else {
element.setAttribute('href', window.URL.createObjectURL(blob));
//set file title
element.setAttribute('download', filename);
//trigger download
element.style.display = 'none';
document.body.appendChild(element);
element.click();
//remove temporary link element
document.body.removeChild(element);
}
}
if (this.table.options.downloadComplete) {
this.table.options.downloadComplete();
}
}
};
//nested field lookup
Download.prototype.getFieldValue = function (field, data) {
var column = this.columnsByField[field];
if (column) {
return column.getFieldValue(data);
}
return false;
};
Download.prototype.commsReceived = function (table, action, data) {
switch (action) {
case "intercept":
this.download(data.type, "", data.options, data.active, data.intercept);
break;
}
};
//downloaders
Download.prototype.downloaders = {
csv: function csv(columns, data, options, setFileContents, config) {
var self = this,
titles = [],
fields = [],
delimiter = options && options.delimiter ? options.delimiter : ",",
fileContents,
output;
//build column headers
function parseSimpleTitles() {
columns.forEach(function (column) {
titles.push('"' + String(column.title).split('"').join('""') + '"');
fields.push(column.field);
});
}
function parseColumnGroup(column, level) {
if (column.subGroups) {
column.subGroups.forEach(function (subGroup) {
parseColumnGroup(subGroup, level + 1);
});
} else {
titles.push('"' + String(column.title).split('"').join('""') + '"');
fields.push(column.definition.field);
}
}
if (config.columnGroups) {
console.warn("Download Warning - CSV downloader cannot process column groups");
columns.forEach(function (column) {
parseColumnGroup(column, 0);
});
} else {
parseSimpleTitles();
}
//generate header row
fileContents = [titles.join(delimiter)];
function parseRows(data) {
//generate each row of the table
data.forEach(function (row) {
var rowData = [];
fields.forEach(function (field) {
var value = self.getFieldValue(field, row);
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) {
case "object":
value = JSON.stringify(value);
break;
case "undefined":
case "null":
value = "";
break;
default:
value = value;
}
//escape quotation marks
rowData.push('"' + String(value).split('"').join('""') + '"');
});
fileContents.push(rowData.join(delimiter));
});
}
function parseGroup(group) {
if (group.subGroups) {
group.subGroups.forEach(function (subGroup) {
parseGroup(subGroup);
});
} else {
parseRows(group.rows);
}
}
if (config.columnCalcs) {
console.warn("Download Warning - CSV downloader cannot process column calculations");
data = data.data;
}
if (config.rowGroups) {
console.warn("Download Warning - CSV downloader cannot process row groups");
data.forEach(function (group) {
parseGroup(group);
});
} else {
parseRows(data);
}
output = fileContents.join("\n");
if (options.bom) {
output = "\uFEFF" + output;
}
setFileContents(output, "text/csv");
},
json: function json(columns, data, options, setFileContents, config) {
var fileContents;
if (config.columnCalcs) {
console.warn("Download Warning - CSV downloader cannot process column calculations");
data = data.data;
}
fileContents = JSON.stringify(data, null, '\t');
setFileContents(fileContents, "application/json");
},
pdf: function pdf(columns, data, options, setFileContents, config) {
var self = this,
fields = [],
header = [],
body = [],
calcs = {},
headerDepth = 1,
table = "",
autoTableParams = {},
rowGroupStyles = options.rowGroupStyles || {
fontStyle: "bold",
fontSize: 12,
cellPadding: 6,
fillColor: 220
},
rowCalcStyles = options.rowCalcStyles || {
fontStyle: "bold",
fontSize: 10,
cellPadding: 4,
fillColor: 232
},
jsPDFParams = options.jsPDF || {},
title = options && options.title ? options.title : "";
if (config.columnCalcs) {
calcs = data.calcs;
data = data.data;
}
if (!jsPDFParams.orientation) {
jsPDFParams.orientation = options.orientation || "landscape";
}
if (!jsPDFParams.unit) {
jsPDFParams.unit = "pt";
}
//build column headers
function parseSimpleTitles() {
columns.forEach(function (column) {
if (column.field) {
header.push(column.title || "");
fields.push(column.field);
}
});
header = [header];
}
function parseColumnGroup(column, level) {
var colSpan = column.width,
rowSpan = 1,
col = {
content: column.title || ""
};
if (column.subGroups) {
column.subGroups.forEach(function (subGroup) {
parseColumnGroup(subGroup, level + 1);
});
rowSpan = 1;
} else {
fields.push(column.definition.field);
rowSpan = headerDepth - level;
}
col.rowSpan = rowSpan;
// col.colSpan = colSpan;
header[level].push(col);
colSpan--;
if (rowSpan > 1) {
for (var i = level + 1; i < headerDepth; i++) {
header[i].push("");
}
}
for (var i = 0; i < colSpan; i++) {
header[level].push("");
}
}
if (config.columnGroups) {
columns.forEach(function (column) {
if (column.depth > headerDepth) {
headerDepth = column.depth;
}
});
for (var i = 0; i < headerDepth; i++) {
header.push([]);
}
columns.forEach(function (column) {
parseColumnGroup(column, 0);
});
} else {
parseSimpleTitles();
}
function parseValue(value) {
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) {
case "object":
value = JSON.stringify(value);
break;
case "undefined":
case "null":
value = "";
break;
default:
value = value;
}
return value;
}
function parseRows(data) {
//build table rows
data.forEach(function (row) {
body.push(parseRow(row));
});
}
function parseRow(row, styles) {
var rowData = [];
fields.forEach(function (field) {
var value = self.getFieldValue(field, row);
value = parseValue(value);
if (styles) {
rowData.push({
content: value,
styles: styles
});
} else {
rowData.push(value);
}
});
return rowData;
}
function parseGroup(group, calcObj) {
var groupData = [];
groupData.push({ content: parseValue(group.key), colSpan: fields.length, styles: rowGroupStyles });
body.push(groupData);
if (group.subGroups) {
group.subGroups.forEach(function (subGroup) {
parseGroup(subGroup, calcObj[group.key] ? calcObj[group.key].groups || {} : {});
});
} else {
if (config.columnCalcs) {
addCalcRow(calcObj, group.key, "top");
}
parseRows(group.rows);
if (config.columnCalcs) {
addCalcRow(calcObj, group.key, "bottom");
}
}
}
function addCalcRow(calcs, selector, pos) {
var calcData = calcs[selector];
if (calcData) {
if (pos) {
calcData = calcData[pos];
}
if (Object.keys(calcData).length) {
body.push(parseRow(calcData, rowCalcStyles));
}
}
}
if (config.rowGroups) {
data.forEach(function (group) {
parseGroup(group, calcs);
});
} else {
if (config.columnCalcs) {
addCalcRow(calcs, "top");
}
parseRows(data);
if (config.columnCalcs) {
addCalcRow(calcs, "bottom");
}
}
var doc = new jsPDF(jsPDFParams); //set document to landscape, better for most tables
if (options && options.autoTable) {
if (typeof options.autoTable === "function") {
autoTableParams = options.autoTable(doc) || {};
} else {
autoTableParams = options.autoTable;
}
}
if (title) {
autoTableParams.addPageContent = function (data) {
doc.text(title, 40, 30);
};
}
autoTableParams.head = header;
autoTableParams.body = body;
doc.autoTable(autoTableParams);
if (options && options.documentProcessing) {
options.documentProcessing(doc);
}
setFileContents(doc.output("arraybuffer"), "application/pdf");
},
xlsx: function xlsx(columns, data, options, setFileContents, config) {
var self = this,
sheetName = options.sheetName || "Sheet1",
workbook = XLSX.utils.book_new(),
calcs = {},
groupRowIndexs = [],
groupColumnIndexs = [],
calcRowIndexs = [],
output;
workbook.SheetNames = [];
workbook.Sheets = {};
if (config.columnCalcs) {
calcs = data.calcs;
data = data.data;
}
function generateSheet() {
var titles = [],
fields = [],
rows = [],
worksheet;
//convert rows to worksheet
function rowsToSheet() {
var sheet = {};
var range = { s: { c: 0, r: 0 }, e: { c: fields.length, r: rows.length } };
XLSX.utils.sheet_add_aoa(sheet, rows);
sheet['!ref'] = XLSX.utils.encode_range(range);
var merges = generateMerges();
if (merges.length) {
sheet["!merges"] = merges;
}
return sheet;
}
function parseSimpleTitles() {
//get field lists
columns.forEach(function (column) {
titles.push(column.title);
fields.push(column.field);
});
rows.push(titles);
}
function parseColumnGroup(column, level) {
if (typeof titles[level] === "undefined") {
titles[level] = [];
}
if (typeof groupColumnIndexs[level] === "undefined") {
groupColumnIndexs[level] = [];
}
if (column.width > 1) {
groupColumnIndexs[level].push({
type: "hoz",
start: titles[level].length,
end: titles[level].length + column.width - 1
});
}
titles[level].push(column.title);
if (column.subGroups) {
column.subGroups.forEach(function (subGroup) {
parseColumnGroup(subGroup, level + 1);
});
} else {
fields.push(column.definition.field);
padColumnTitles(fields.length - 1, level);
groupColumnIndexs[level].push({
type: "vert",
start: fields.length - 1
});
}
}
function padColumnTitles() {
var max = 0;
titles.forEach(function (title) {
var len = title.length;
if (len > max) {
max = len;
}
});
titles.forEach(function (title) {
var len = title.length;
if (len < max) {
for (var i = len; i < max; i++) {
title.push("");
}
}
});
}
if (config.columnGroups) {
columns.forEach(function (column) {
parseColumnGroup(column, 0);
});
titles.forEach(function (title) {
rows.push(title);
});
} else {
parseSimpleTitles();
}
function generateMerges() {
var output = [];
groupRowIndexs.forEach(function (index) {
output.push({ s: { r: index, c: 0 }, e: { r: index, c: fields.length - 1 } });
});
groupColumnIndexs.forEach(function (merges, level) {
merges.forEach(function (merge) {
if (merge.type === "hoz") {
output.push({ s: { r: level, c: merge.start }, e: { r: level, c: merge.end } });
} else {
if (level != titles.length - 1) {
output.push({ s: { r: level, c: merge.start }, e: { r: titles.length - 1, c: merge.start } });
}
}
});
});
return output;
}
//generate each row of the table
function parseRows(data) {
data.forEach(function (row) {
rows.push(parseRow(row));
});
}
function parseRow(row) {
var rowData = [];
fields.forEach(function (field) {
var value = self.getFieldValue(field, row);
rowData.push(!(value instanceof Date) && (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" ? JSON.stringify(value) : value);
});
return rowData;
}
function addCalcRow(calcs, selector, pos) {
var calcData = calcs[selector];
if (calcData) {
if (pos) {
calcData = calcData[pos];
}
if (Object.keys(calcData).length) {
calcRowIndexs.push(rows.length);
rows.push(parseRow(calcData));
}
}
}
function parseGroup(group, calcObj) {
var groupData = [];
groupData.push(group.key);
groupRowIndexs.push(rows.length);
rows.push(groupData);
if (group.subGroups) {
group.subGroups.forEach(function (subGroup) {
parseGroup(subGroup, calcObj[group.key] ? calcObj[group.key].groups || {} : {});
});
} else {
if (config.columnCalcs) {
addCalcRow(calcObj, group.key, "top");
}
parseRows(group.rows);
if (config.columnCalcs) {
addCalcRow(calcObj, group.key, "bottom");
}
}
}
if (config.rowGroups) {
data.forEach(function (group) {
parseGroup(group, calcs);
});
} else {
if (config.columnCalcs) {
addCalcRow(calcs, "top");
}
parseRows(data);
if (config.columnCalcs) {
addCalcRow(calcs, "bottom");
}
}
worksheet = rowsToSheet();
return worksheet;
}
if (options.sheetOnly) {
setFileContents(generateSheet());
return;
}
if (options.sheets) {
for (var sheet in options.sheets) {
if (options.sheets[sheet] === true) {
workbook.SheetNames.push(sheet);
workbook.Sheets[sheet] = generateSheet();
} else {
workbook.SheetNames.push(sheet);
this.table.modules.comms.send(options.sheets[sheet], "download", "intercept", {
type: "xlsx",
options: { sheetOnly: true },
active: self.active,
intercept: function intercept(data) {
workbook.Sheets[sheet] = data;
}
});
}
}
} else {
workbook.SheetNames.push(sheetName);
workbook.Sheets[sheetName] = generateSheet();
}
if (options.documentProcessing) {
workbook = options.documentProcessing(workbook);
}
//convert workbook to binary array
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) {
view[i] = s.charCodeAt(i) & 0xFF;
}return buf;
}
output = XLSX.write(workbook, { bookType: 'xlsx', bookSST: true, type: 'binary' });
setFileContents(s2ab(output), "application/octet-stream");
},
html: function html(columns, data, options, setFileContents, config) {
if (this.table.modExists("export", true)) {
setFileContents(this.table.modules.export.getHtml(true, options.style, config), "text/html");
}
}
};
Tabulator.prototype.registerModule("download", Download);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Download=function(o){this.table=o,this.fields={},this.columnsByIndex=[],this.columnsByField={},this.config={},this.active=!1};Download.prototype.download=function(o,t,n,e,i){function s(n,e){i?!0===i?a.triggerDownload(n,e,o,t,!0):i(n):a.triggerDownload(n,e,o,t)}var a=this,r=!1;this.processConfig(),this.active=e,"function"==typeof o?r=o:a.downloaders[o]?r=a.downloaders[o]:console.warn("Download Error - No such download type found: ",o),this.processColumns(),r&&r.call(this,a.processDefinitions(),a.processData(e||"active"),n||{},s,this.config)},Download.prototype.processConfig=function(){var o={columnGroups:!0,rowGroups:!0,columnCalcs:!0,dataTree:!0};if(this.table.options.downloadConfig)for(var t in this.table.options.downloadConfig)o[t]=this.table.options.downloadConfig[t];this.config.rowGroups=o.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows"),o.columnGroups&&this.table.columnManager.columns.length!=this.table.columnManager.columnsByIndex.length&&(this.config.columnGroups=!0),o.columnCalcs&&this.table.modExists("columnCalcs")&&(this.config.columnCalcs=!0),o.dataTree&&this.table.options.dataTree&&this.table.modExists("dataTree")&&(this.config.dataTree=!0)},Download.prototype.processColumns=function(){var o=this;o.columnsByIndex=[],o.columnsByField={},o.table.columnManager.columnsByIndex.forEach(function(t){t.field&&!1!==t.definition.download&&(t.visible||!t.visible&&t.definition.download)&&(o.columnsByIndex.push(t),o.columnsByField[t.field]=t)})},Download.prototype.processDefinitions=function(){var o=this,t=[];return this.config.columnGroups?o.table.columnManager.columns.forEach(function(n){var e=o.processColumnGroup(n);e&&t.push(e)}):o.columnsByIndex.forEach(function(n){!1!==n.download&&t.push(o.processDefinition(n))}),t},Download.prototype.processColumnGroup=function(o){var t=this,n=o.columns,e=0,i=this.processDefinition(o),s={type:"group",title:i.title,depth:1};if(n.length){if(s.subGroups=[],s.width=0,n.forEach(function(o){var n=t.processColumnGroup(o);n.depth>e&&(e=n.depth),n&&(s.width+=n.width,s.subGroups.push(n))}),s.depth+=e,!s.width)return!1}else{if(!o.field||!1===o.definition.download||!(o.visible||!o.visible&&o.definition.download))return!1;s.width=1,s.definition=i}return s},Download.prototype.processDefinition=function(o){var t={};for(var n in o.definition)t[n]=o.definition[n];return void 0!==o.definition.downloadTitle&&(t.title=o.definition.downloadTitle),t},Download.prototype.processData=function(o){var t=this,n=this,e=[],i=[],s=!1,a={};return this.config.rowGroups?("visible"==o?(s=n.table.rowManager.getRows(o),s.forEach(function(o){if("row"==o.type){var t=o.getGroup();-1===i.indexOf(t)&&i.push(t)}})):i=this.table.modules.groupRows.getGroups(),i.forEach(function(o){e.push(t.processGroupData(o,s))})):(this.config.dataTree&&(o=o="display"),e=n.table.rowManager.getData(o,"download")),this.config.columnCalcs&&(a=this.table.getCalcResults(),e={calcs:a,data:e}),"function"==typeof n.table.options.downloadDataFormatter&&(e=n.table.options.downloadDataFormatter(e)),e},Download.prototype.processGroupData=function(o,t){var n=this,e=o.getSubGroups(),i={type:"group",key:o.key};return e.length?(i.subGroups=[],e.forEach(function(o){i.subGroups.push(n.processGroupData(o,t))})):t?(i.rows=[],o.rows.forEach(function(o){t.indexOf(o)>-1&&i.rows.push(o.getData("download"))})):i.rows=o.getData(!0,"download"),i},Download.prototype.triggerDownload=function(o,t,n,e,i){var s=document.createElement("a"),a=new Blob([o],{type:t}),e=e||"Tabulator."+("function"==typeof n?"txt":n);(a=this.table.options.downloadReady.call(this.table,o,a))&&(i?window.open(window.URL.createObjectURL(a)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(a,e):(s.setAttribute("href",window.URL.createObjectURL(a)),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},Download.prototype.getFieldValue=function(o,t){var n=this.columnsByField[o];return!!n&&n.getFieldValue(t)},Download.prototype.commsReceived=function(o,t,n){switch(t){case"intercept":this.download(n.type,"",n.options,n.active,n.intercept)}},Download.prototype.downloaders={csv:function(o,t,n,e,i){function s(o,t){o.subGroups?o.subGroups.forEach(function(o){s(o,t+1)}):(f.push('"'+String(o.title).split('"').join('""')+'"'),p.push(o.definition.field))}function a(o){o.forEach(function(o){var t=[];p.forEach(function(n){var e=c.getFieldValue(n,o);switch(void 0===e?"undefined":_typeof(e)){case"object":e=JSON.stringify(e);break;case"undefined":case"null":e="";break;default:e=e}t.push('"'+String(e).split('"').join('""')+'"')}),u.push(t.join(d))})}function r(o){o.subGroups?o.subGroups.forEach(function(o){r(o)}):a(o.rows)}vaLine truncated
File diff suppressed because it is too large. Load diff
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="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},Edit=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1};Edit.prototype.initializeColumn=function(e){var t=this,i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.editor]?i.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),t.editors[e.definition.formatter]?i.editor=t.editors[e.definition.formatter]:i.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}i.editor&&(e.modules.edit=i)},Edit.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},Edit.prototype.clearEditor=function(){var e,t=this.currentCell;if(this.invalidEdit=!1,t){for(this.currentCell=!1,e=t.getElement(),e.classList.remove("tabulator-validation-fail"),e.classList.remove("tabulator-editing");e.firstChild;)e.removeChild(e.firstChild);t.row.getElement().classList.remove("tabulator-row-editing")}},Edit.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(),e.setValueActual(e.getValue()),e.cellRendered(),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},Edit.prototype.bindEditor=function(e){var t=this,i=e.getElement();i.setAttribute("tabindex",0),i.addEventListener("click",function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})}),i.addEventListener("mousedown",function(e){t.mouseClick=!0}),i.addEventListener("focus",function(i){t.recursionBlock||t.edit(e,i,!1)})},Edit.prototype.focusCellNoEvent=function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1},Edit.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},Edit.prototype.focusScrollAdjust=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.offsetTop<t?this.table.rowManager.element.scrollTop-=t-n.offsetTop:n.offsetTop+n.offsetHeight>i&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i)}},Edit.prototype.edit=function(e,t,i){function n(t){if(u.currentCell===e){var i=!0;return e.column.modules.validate&&u.table.modExists("validate")&&(i=u.table.modules.validate.validate(e.column.modules.validate,e.getComponent(),t)),!0===i?(u.clearEditor(),e.setValue(t,!0),u.table.options.dataTree&&u.table.modExists("dataTree")&&u.table.modules.dataTree.checkForRestyle(e),!0):(u.invalidEdit=!0,m.classList.add("tabulator-validation-fail"),u.focusCellNoEvent(e,!0),c(),u.table.options.validationFailed.call(u.table,e.getComponent(),t,i),!1)}}function a(){u.currentCell===e&&(u.cancelEdit(),u.table.options.dataTree&&u.table.modExists("dataTree")&&u.table.modules.dataTree.checkForRestyle(e))}function o(e){c=e}var r,l,s,u=this,d=!0,c=function(){},m=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,m.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":d=e.column.modules.edit.check(e.getComponent());break;case"boolean":d=e.column.modules.edit.check}if(d||i){if(u.cancelEdit(),u.currentCell=e,this.focusScrollAdjust(e),l=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,l)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,l),u.table.options.cellEditing.call(this.table,l),s="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(l):e.column.modules.edit.params,!1===(r=e.column.modules.edit.editor.call(u,l,o,n,a,s)))return m.blur(),!1;if(!(r instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",r),m.blur(),!1;for(m.classList.add("tabulator-editing"),e.row.getElement().classList.add("tLine truncated
+471
View File
@@ -0,0 +1,471 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Export = function Export(table) {
this.table = table; //hold Tabulator object
this.config = {};
this.cloneTableStyle = true;
this.colVisProp = "";
};
Export.prototype.genereateTable = function (config, style, range, colVisProp) {
this.cloneTableStyle = style;
this.config = config || {};
this.colVisProp = colVisProp;
var table = document.createElement("table");
table.classList.add("tabulator-print-table");
if (this.config.columnHeaders !== false) {
table.appendChild(this.generateHeaderElements());
}
table.appendChild(this.generateBodyElements(this.rowLookup(range)));
this.mapElementStyles(this.table.element, table, ["border-top", "border-left", "border-right", "border-bottom"]);
return table;
};
Export.prototype.rowLookup = function (range) {
var _this = this;
var rows = [];
if (typeof range == "function") {
range.call(this.table).forEach(function (row) {
row = _this.table.rowManager.findRow(row);
if (row) {
rows.push(row);
}
});
} else {
switch (range) {
case true:
case "visible":
rows = this.table.rowManager.getVisibleRows(true);
break;
case "all":
rows = this.table.rowManager.rows;
break;
case "selected":
rows = this.table.modules.selectRow.selectedRows;
break;
case "active":
default:
rows = this.table.rowManager.getDisplayRows();
}
}
return Object.assign([], rows);
};
Export.prototype.generateColumnGroupHeaders = function () {
var _this2 = this;
var output = [];
var columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;
columns.forEach(function (column) {
var colData = _this2.processColumnGroup(column);
if (colData) {
output.push(colData);
}
});
return output;
};
Export.prototype.processColumnGroup = function (column) {
var _this3 = this;
var subGroups = column.columns,
maxDepth = 0;
var groupData = {
title: column.definition.title,
column: column,
depth: 1
};
if (subGroups.length) {
groupData.subGroups = [];
groupData.width = 0;
subGroups.forEach(function (subGroup) {
var subGroupData = _this3.processColumnGroup(subGroup);
if (subGroupData) {
groupData.width += subGroupData.width;
groupData.subGroups.push(subGroupData);
if (subGroupData.depth > maxDepth) {
maxDepth = subGroupData.depth;
}
}
});
groupData.depth += maxDepth;
if (!groupData.width) {
return false;
}
} else {
if (this.columnVisCheck(column)) {
groupData.width = 1;
} else {
return false;
}
}
return groupData;
};
Export.prototype.groupHeadersToRows = function (columns) {
var headers = [],
headerDepth = 0;
function parseColumnGroup(column, level) {
var depth = headerDepth - level;
if (typeof headers[level] === "undefined") {
headers[level] = [];
}
column.height = column.subGroups ? 1 : depth - column.depth + 1;
headers[level].push(column);
if (column.subGroups) {
column.subGroups.forEach(function (subGroup) {
parseColumnGroup(subGroup, level + 1);
});
}
}
//calculate maximum header debth
columns.forEach(function (column) {
if (column.depth > headerDepth) {
headerDepth = column.depth;
}
});
columns.forEach(function (column) {
parseColumnGroup(column, 0);
});
return headers;
};
Export.prototype.generateHeaderElements = function () {
var _this4 = this;
var headerEl = document.createElement("thead");
var rows = this.groupHeadersToRows(this.generateColumnGroupHeaders());
rows.forEach(function (row) {
var rowEl = document.createElement("tr");
_this4.mapElementStyles(_this4.table.columnManager.getHeadersElement(), headerEl, ["border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]);
row.forEach(function (column) {
var cellEl = document.createElement("th");
var classNames = column.column.definition.cssClass ? column.column.definition.cssClass.split(" ") : [];
cellEl.colSpan = column.width;
cellEl.rowSpan = column.height;
cellEl.innerHTML = column.column.definition.title;
if (_this4.cloneTableStyle) {
cellEl.style.boxSizing = "border-box";
}
classNames.forEach(function (className) {
cellEl.classList.add(className);
});
_this4.mapElementStyles(column.column.getElement(), cellEl, ["text-align", "border-top", "border-left", "border-right", "border-bottom", "background-color", "color", "font-weight", "font-family", "font-size"]);
_this4.mapElementStyles(column.column.contentElement, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]);
if (column.column.visible) {
_this4.mapElementStyles(column.column.getElement(), cellEl, ["width"]);
} else {
if (column.column.definition.width) {
cellEl.style.width = column.column.definition.width + "px";
}
}
if (column.column.parent) {
_this4.mapElementStyles(column.column.parent.groupElement, cellEl, ["border-top"]);
}
rowEl.appendChild(cellEl);
});
headerEl.appendChild(rowEl);
});
return headerEl;
};
Export.prototype.generateBodyElements = function (rows) {};
Export.prototype.generateBodyElements = function (rows) {
var _this5 = this;
var oddRow, evenRow, calcRow, firstRow, firstCell, firstGroup, lastCell, styleCells, styleRow, treeElementField, rowFormatter;
//assign row formatter
rowFormatter = this.table.options["rowFormatter" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];
rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;
//lookup row styles
if (this.cloneTableStyle && window.getComputedStyle) {
oddRow = this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)");
evenRow = this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)");
calcRow = this.table.element.querySelector(".tabulator-row.tabulator-calcs");
firstRow = this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)");
firstGroup = this.table.element.getElementsByClassName("tabulator-group")[0];
if (firstRow) {
styleCells = firstRow.getElementsByClassName("tabulator-cell");
firstCell = styleCells[0];
lastCell = styleCells[styleCells.length - 1];
}
}
var bodyEl = document.createElement("tbody");
var columns = [];
if (this.config.columnCalcs !== false && this.table.modExists("columnCalcs")) {
if (this.table.modules.columnCalcs.topInitialized) {
rows.unshift(this.table.modules.columnCalcs.topRow);
}
if (this.table.modules.columnCalcs.botInitialized) {
rows.push(this.table.modules.columnCalcs.botRow);
}
}
this.table.columnManager.columnsByIndex.forEach(function (column) {
if (_this5.columnVisCheck(column)) {
columns.push(column);
}
});
if (this.table.options.dataTree && this.config.dataTree !== false && this.table.modExists("columnCalcs")) {
treeElementField = this.table.modules.dataTree.elementField;
}
rows = rows.filter(function (row) {
switch (row.type) {
case "group":
return _this5.config.rowGroups !== false;
break;
case "calc":
return _this5.config.columnCalcs !== false;
break;
}
return true;
});
if (rows.length > 1000) {
console.warn("It may take a long time to render an HTML table with more than 1000 rows");
}
rows.forEach(function (row, i) {
var rowData = row.getData(_this5.colVisProp);
var rowEl = document.createElement("tr");
rowEl.classList.add("tabulator-print-table-row");
switch (row.type) {
case "group":
var cellEl = document.createElement("td");
cellEl.colSpan = columns.length;
cellEl.innerHTML = row.key;
rowEl.classList.add("tabulator-print-table-group");
_this5.mapElementStyles(firstGroup, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]);
_this5.mapElementStyles(firstGroup, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom"]);
rowEl.appendChild(cellEl);
break;
case "calc":
rowEl.classList.add("tabulator-print-table-calcs");
case "row":
if (_this5.table.options.dataTree && _this5.config.dataTree === false && row.modules.dataTree.parent) {
return;
}
columns.forEach(function (column, i) {
var cellEl = document.createElement("td");
var value = column.getFieldValue(rowData);
var cellWrapper = {
modules: {},
getValue: function getValue() {
return value;
},
getField: function getField() {
return column.definition.field;
},
getElement: function getElement() {
return cellEl;
},
getColumn: function getColumn() {
return column.getComponent();
},
getData: function getData() {
return rowData;
},
getRow: function getRow() {
return row.getComponent();
},
getComponent: function getComponent() {
return cellWrapper;
},
column: column
};
var classNames = column.definition.cssClass ? column.definition.cssClass.split(" ") : [];
classNames.forEach(function (className) {
cellEl.classList.add(className);
});
if (_this5.table.modExists("format") && _this5.config.formatCells !== false) {
value = _this5.table.modules.format.formatExportValue(cellWrapper, _this5.colVisProp);
} else {
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) {
case "object":
value = JSON.stringify(value);
break;
case "undefined":
case "null":
value = "";
break;
default:
value = value;
}
}
if (value instanceof Node) {
cellEl.appendChild(value);
} else {
cellEl.innerHTML = value;
}
if (firstCell) {
_this5.mapElementStyles(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"]);
if (column.definition.align) {
cellEl.style.textAlign = column.definition.align;
}
}
if (_this5.table.options.dataTree && _this5.config.dataTree !== false) {
if (treeElementField && treeElementField == column.field || !treeElementField && i == 0) {
if (row.modules.dataTree.controlEl) {
cellEl.insertBefore(row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);
}
if (row.modules.dataTree.branchEl) {
cellEl.insertBefore(row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);
}
}
}
rowEl.appendChild(cellEl);
if (cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback) {
cellWrapper.modules.format.renderedCallback();
}
});
styleRow = row.type == "calc" ? calcRow : i % 2 && evenRow ? evenRow : oddRow;
_this5.mapElementStyles(styleRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]);
if (rowFormatter && _this5.config.formatCells !== false) {
var rowComponent = row.getComponent();
rowComponent.getElement = function () {
return rowEl;
};
rowFormatter(rowComponent);
}
break;
}
bodyEl.appendChild(rowEl);
});
return bodyEl;
};
Export.prototype.columnVisCheck = function (column) {
return column.definition[this.colVisProp] !== false && (column.visible || !column.visible && column.definition[this.colVisProp]);
};
Export.prototype.getHtml = function (visible, style, config, colVisProp) {
var holder = document.createElement("div");
holder.appendChild(this.genereateTable(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || "htmlOutput"));
return holder.innerHTML;
};
Export.prototype.mapElementStyles = function (from, to, props) {
if (this.cloneTableStyle && from && to) {
var lookup = {
"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 fromStyle = window.getComputedStyle(from);
props.forEach(function (prop) {
to.style[lookup[prop]] = fromStyle.getPropertyValue(prop);
});
}
}
};
Tabulator.prototype.registerModule("export", Export);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Export=function(t){this.table=t,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};Export.prototype.genereateTable=function(t,e,o,n){this.cloneTableStyle=e,this.config=t||{},this.colVisProp=n;var r=document.createElement("table");return r.classList.add("tabulator-print-table"),!1!==this.config.columnHeaders&&r.appendChild(this.generateHeaderElements()),r.appendChild(this.generateBodyElements(this.rowLookup(o))),this.mapElementStyles(this.table.element,r,["border-top","border-left","border-right","border-bottom"]),r},Export.prototype.rowLookup=function(t){var e=this,o=[];if("function"==typeof t)t.call(this.table).forEach(function(t){(t=e.table.rowManager.findRow(t))&&o.push(t)});else switch(t){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.rowManager.getDisplayRows()}return Object.assign([],o)},Export.prototype.generateColumnGroupHeaders=function(){var t=this,e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var n=t.processColumnGroup(o);n&&e.push(n)}),e},Export.prototype.processColumnGroup=function(t){var e=this,o=t.columns,n=0,r={title:t.definition.title,column:t,depth:1};if(o.length){if(r.subGroups=[],r.width=0,o.forEach(function(t){var o=e.processColumnGroup(t);o&&(r.width+=o.width,r.subGroups.push(o),o.depth>n&&(n=o.depth))}),r.depth+=n,!r.width)return!1}else{if(!this.columnVisCheck(t))return!1;r.width=1}return r},Export.prototype.groupHeadersToRows=function(t){function e(t,r){var l=n-r;void 0===o[r]&&(o[r]=[]),t.height=t.subGroups?1:l-t.depth+1,o[r].push(t),t.subGroups&&t.subGroups.forEach(function(t){e(t,r+1)})}var o=[],n=0;return t.forEach(function(t){t.depth>n&&(n=t.depth)}),t.forEach(function(t){e(t,0)}),o},Export.prototype.generateHeaderElements=function(){var t=this,e=document.createElement("thead");return this.groupHeadersToRows(this.generateColumnGroupHeaders()).forEach(function(o){var n=document.createElement("tr");t.mapElementStyles(t.table.columnManager.getHeadersElement(),e,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),o.forEach(function(e){var o=document.createElement("th"),r=e.column.definition.cssClass?e.column.definition.cssClass.split(" "):[];o.colSpan=e.width,o.rowSpan=e.height,o.innerHTML=e.column.definition.title,t.cloneTableStyle&&(o.style.boxSizing="border-box"),r.forEach(function(t){o.classList.add(t)}),t.mapElementStyles(e.column.getElement(),o,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.mapElementStyles(e.column.contentElement,o,["padding-top","padding-left","padding-right","padding-bottom"]),e.column.visible?t.mapElementStyles(e.column.getElement(),o,["width"]):e.column.definition.width&&(o.style.width=e.column.definition.width+"px"),e.column.parent&&t.mapElementStyles(e.column.parent.groupElement,o,["border-top"]),n.appendChild(o)}),e.appendChild(n)}),e},Export.prototype.generateBodyElements=function(t){},Export.prototype.generateBodyElements=function(t){var e,o,n,r,l,a,i,s,d,c,u=this;c=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],c=null!==c?c:this.table.options.rowFormatter,this.cloneTableStyle&&window.getComputedStyle&&(e=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),o=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),n=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),r=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),a=this.table.element.getElementsByClassName("tabulator-group")[0],r&&(i=r.getElementsByClassName("tabulator-cell"),l=i[0],i[i.length-1]));var p=document.createElement("tbody"),m=[];return!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&t.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&t.push(this.table.modules.columnCalcs.botRow)),this.table.columnManager.columnsByIndex.forEach(function(t){u.columnVisCheck(t)&&m.push(t)}),this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(d=this.table.modules.dataTree.elementField),t=t.filter(function(t){switch(t.type){case"group":return!1!==u.config.rowGroups;case"calc":return!1!==u.config.columnCalcs}return!0}),t.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rowLine truncated
+766
View File
@@ -0,0 +1,766 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Filter = function Filter(table) {
this.table = table; //hold Tabulator object
this.filterList = []; //hold filter list
this.headerFilters = {}; //hold column filters
this.headerFilterColumns = []; //hold columns that use header filters
this.prevHeaderFilterChangeCheck = "";
this.prevHeaderFilterChangeCheck = "{}";
this.changed = false; //has filtering changed since last render
};
//initialize column header filter
Filter.prototype.initializeColumn = function (column, value) {
var self = this,
field = column.getField(),
params;
//handle successfull value change
function success(value) {
var filterType = column.modules.filter.tagType == "input" && column.modules.filter.attrType == "text" || column.modules.filter.tagType == "textarea" ? "partial" : "match",
type = "",
filterChangeCheck = "",
filterFunc;
if (typeof column.modules.filter.prevSuccess === "undefined" || column.modules.filter.prevSuccess !== value) {
column.modules.filter.prevSuccess = value;
if (!column.modules.filter.emptyFunc(value)) {
column.modules.filter.value = value;
switch (_typeof(column.definition.headerFilterFunc)) {
case "string":
if (self.filters[column.definition.headerFilterFunc]) {
type = column.definition.headerFilterFunc;
filterFunc = function filterFunc(data) {
var params = column.definition.headerFilterFuncParams || {};
var fieldVal = column.getFieldValue(data);
params = typeof params === "function" ? params(value, fieldVal, data) : params;
return self.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);
};
} else {
console.warn("Header Filter Error - Matching filter function not found: ", column.definition.headerFilterFunc);
}
break;
case "function":
filterFunc = function filterFunc(data) {
var params = column.definition.headerFilterFuncParams || {};
var fieldVal = column.getFieldValue(data);
params = typeof params === "function" ? params(value, fieldVal, data) : params;
return column.definition.headerFilterFunc(value, fieldVal, data, params);
};
type = filterFunc;
break;
}
if (!filterFunc) {
switch (filterType) {
case "partial":
filterFunc = function filterFunc(data) {
var colVal = column.getFieldValue(data);
if (typeof colVal !== 'undefined' && colVal !== null) {
return String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;
} else {
return false;
}
};
type = "like";
break;
default:
filterFunc = function filterFunc(data) {
return column.getFieldValue(data) == value;
};
type = "=";
}
}
self.headerFilters[field] = { value: value, func: filterFunc, type: type };
} else {
delete self.headerFilters[field];
}
filterChangeCheck = JSON.stringify(self.headerFilters);
if (self.prevHeaderFilterChangeCheck !== filterChangeCheck) {
self.prevHeaderFilterChangeCheck = filterChangeCheck;
self.changed = true;
self.table.rowManager.filterRefresh();
}
}
return true;
}
column.modules.filter = {
success: success,
attrType: false,
tagType: false,
emptyFunc: false
};
this.generateHeaderFilterElement(column);
};
Filter.prototype.generateHeaderFilterElement = function (column, initialValue, reinitialize) {
var _this = this;
var self = this,
success = column.modules.filter.success,
field = column.getField(),
filterElement,
editor,
editorElement,
cellWrapper,
typingTimer,
searchTrigger,
params;
//handle aborted edit
function cancel() {}
if (column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode) {
column.contentElement.removeChild(column.modules.filter.headerElement.parentNode);
}
if (field) {
//set empty value function
column.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function (value) {
return !value && value !== "0";
};
filterElement = document.createElement("div");
filterElement.classList.add("tabulator-header-filter");
//set column editor
switch (_typeof(column.definition.headerFilter)) {
case "string":
if (self.table.modules.edit.editors[column.definition.headerFilter]) {
editor = self.table.modules.edit.editors[column.definition.headerFilter];
if ((column.definition.headerFilter === "tick" || column.definition.headerFilter === "tickCross") && !column.definition.headerFilterEmptyCheck) {
column.modules.filter.emptyFunc = function (value) {
return value !== true && value !== false;
};
}
} else {
console.warn("Filter Error - Cannot build header filter, No such editor found: ", column.definition.editor);
}
break;
case "function":
editor = column.definition.headerFilter;
break;
case "boolean":
if (column.modules.edit && column.modules.edit.editor) {
editor = column.modules.edit.editor;
} else {
if (column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]) {
editor = self.table.modules.edit.editors[column.definition.formatter];
if ((column.definition.formatter === "tick" || column.definition.formatter === "tickCross") && !column.definition.headerFilterEmptyCheck) {
column.modules.filter.emptyFunc = function (value) {
return value !== true && value !== false;
};
}
} else {
editor = self.table.modules.edit.editors["input"];
}
}
break;
}
if (editor) {
cellWrapper = {
getValue: function getValue() {
return typeof initialValue !== "undefined" ? initialValue : "";
},
getField: function getField() {
return column.definition.field;
},
getElement: function getElement() {
return filterElement;
},
getColumn: function getColumn() {
return column.getComponent();
},
getRow: function getRow() {
return {
normalizeHeight: function normalizeHeight() {}
};
}
};
params = column.definition.headerFilterParams || {};
params = typeof params === "function" ? params.call(self.table) : params;
editorElement = editor.call(this.table.modules.edit, cellWrapper, function () {}, success, cancel, params);
if (!editorElement) {
console.warn("Filter Error - Cannot add filter to " + field + " column, editor returned a value of false");
return;
}
if (!(editorElement instanceof Node)) {
console.warn("Filter Error - Cannot add filter to " + field + " column, editor should return an instance of Node, the editor returned:", editorElement);
return;
}
//set Placeholder Text
if (field) {
self.table.modules.localize.bind("headerFilters|columns|" + column.definition.field, function (value) {
editorElement.setAttribute("placeholder", typeof value !== "undefined" && value ? value : self.table.modules.localize.getText("headerFilters|default"));
});
} else {
self.table.modules.localize.bind("headerFilters|default", function (value) {
editorElement.setAttribute("placeholder", typeof self.column.definition.headerFilterPlaceholder !== "undefined" && self.column.definition.headerFilterPlaceholder ? self.column.definition.headerFilterPlaceholder : value);
});
}
//focus on element on click
editorElement.addEventListener("click", function (e) {
e.stopPropagation();
editorElement.focus();
});
editorElement.addEventListener("focus", function (e) {
var left = _this.table.columnManager.element.scrollLeft;
if (left !== _this.table.rowManager.element.scrollLeft) {
_this.table.rowManager.scrollHorizontal(left);
_this.table.columnManager.scrollHorizontal(left);
}
});
//live update filters as user types
typingTimer = false;
searchTrigger = function searchTrigger(e) {
if (typingTimer) {
clearTimeout(typingTimer);
}
typingTimer = setTimeout(function () {
success(editorElement.value);
}, self.table.options.headerFilterLiveFilterDelay);
};
column.modules.filter.headerElement = editorElement;
column.modules.filter.attrType = editorElement.hasAttribute("type") ? editorElement.getAttribute("type").toLowerCase() : "";
column.modules.filter.tagType = editorElement.tagName.toLowerCase();
if (column.definition.headerFilterLiveFilter !== false) {
if (!(column.definition.headerFilter === 'autocomplete' || column.definition.headerFilter === 'tickCross' || (column.definition.editor === 'autocomplete' || column.definition.editor === 'tickCross') && column.definition.headerFilter === true)) {
editorElement.addEventListener("keyup", searchTrigger);
editorElement.addEventListener("search", searchTrigger);
//update number filtered columns on change
if (column.modules.filter.attrType == "number") {
editorElement.addEventListener("change", function (e) {
success(editorElement.value);
});
}
//change text inputs to search inputs to allow for clearing of field
if (column.modules.filter.attrType == "text" && this.table.browser !== "ie") {
editorElement.setAttribute("type", "search");
// editorElement.off("change blur"); //prevent blur from triggering filter and preventing selection click
}
}
//prevent input and select elements from propegating click to column sorters etc
if (column.modules.filter.tagType == "input" || column.modules.filter.tagType == "select" || column.modules.filter.tagType == "textarea") {
editorElement.addEventListener("mousedown", function (e) {
e.stopPropagation();
});
}
}
filterElement.appendChild(editorElement);
column.contentElement.appendChild(filterElement);
if (!reinitialize) {
self.headerFilterColumns.push(column);
}
}
} else {
console.warn("Filter Error - Cannot add header filter, column has no field set:", column.definition.title);
}
};
//hide all header filter elements (used to ensure correct column widths in "fitData" layout mode)
Filter.prototype.hideHeaderFilterElements = function () {
this.headerFilterColumns.forEach(function (column) {
if (column.modules.filter && column.modules.filter.headerElement) {
column.modules.filter.headerElement.style.display = 'none';
}
});
};
//show all header filter elements (used to ensure correct column widths in "fitData" layout mode)
Filter.prototype.showHeaderFilterElements = function () {
this.headerFilterColumns.forEach(function (column) {
if (column.modules.filter && column.modules.filter.headerElement) {
column.modules.filter.headerElement.style.display = '';
}
});
};
//programatically set focus of header filter
Filter.prototype.setHeaderFilterFocus = function (column) {
if (column.modules.filter && column.modules.filter.headerElement) {
column.modules.filter.headerElement.focus();
} else {
console.warn("Column Filter Focus Error - No header filter set on column:", column.getField());
}
};
//programmatically get value of header filter
Filter.prototype.getHeaderFilterValue = function (column) {
if (column.modules.filter && column.modules.filter.headerElement) {
return column.modules.filter.headerElement.value;
} else {
console.warn("Column Filter Error - No header filter set on column:", column.getField());
}
};
//programatically set value of header filter
Filter.prototype.setHeaderFilterValue = function (column, value) {
if (column) {
if (column.modules.filter && column.modules.filter.headerElement) {
this.generateHeaderFilterElement(column, value, true);
column.modules.filter.success(value);
} else {
console.warn("Column Filter Error - No header filter set on column:", column.getField());
}
}
};
Filter.prototype.reloadHeaderFilter = function (column) {
if (column) {
if (column.modules.filter && column.modules.filter.headerElement) {
this.generateHeaderFilterElement(column, column.modules.filter.value, true);
} else {
console.warn("Column Filter Error - No header filter set on column:", column.getField());
}
}
};
//check if the filters has changed since last use
Filter.prototype.hasChanged = function () {
var changed = this.changed;
this.changed = false;
return changed;
};
//set standard filters
Filter.prototype.setFilter = function (field, type, value) {
var self = this;
self.filterList = [];
if (!Array.isArray(field)) {
field = [{ field: field, type: type, value: value }];
}
self.addFilter(field);
};
//add filter to array
Filter.prototype.addFilter = function (field, type, value) {
var self = this;
if (!Array.isArray(field)) {
field = [{ field: field, type: type, value: value }];
}
field.forEach(function (filter) {
filter = self.findFilter(filter);
if (filter) {
self.filterList.push(filter);
self.changed = true;
}
});
if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) {
this.table.modules.persistence.save("filter");
}
};
Filter.prototype.findFilter = function (filter) {
var self = this,
column;
if (Array.isArray(filter)) {
return this.findSubFilters(filter);
}
var filterFunc = false;
if (typeof filter.field == "function") {
filterFunc = function filterFunc(data) {
return filter.field(data, filter.type || {}); // pass params to custom filter function
};
} else {
if (self.filters[filter.type]) {
column = self.table.columnManager.getColumnByField(filter.field);
if (column) {
filterFunc = function filterFunc(data) {
return self.filters[filter.type](filter.value, column.getFieldValue(data));
};
} else {
filterFunc = function filterFunc(data) {
return self.filters[filter.type](filter.value, data[filter.field]);
};
}
} else {
console.warn("Filter Error - No such filter type found, ignoring: ", filter.type);
}
}
filter.func = filterFunc;
return filter.func ? filter : false;
};
Filter.prototype.findSubFilters = function (filters) {
var self = this,
output = [];
filters.forEach(function (filter) {
filter = self.findFilter(filter);
if (filter) {
output.push(filter);
}
});
return output.length ? output : false;
};
//get all filters
Filter.prototype.getFilters = function (all, ajax) {
var output = [];
if (all) {
output = this.getHeaderFilters();
}
if (ajax) {
output.forEach(function (item) {
if (typeof item.type == "function") {
item.type = "function";
}
});
}
output = output.concat(this.filtersToArray(this.filterList, ajax));
return output;
};
//filter to Object
Filter.prototype.filtersToArray = function (filterList, ajax) {
var _this2 = this;
var output = [];
filterList.forEach(function (filter) {
var item;
if (Array.isArray(filter)) {
output.push(_this2.filtersToArray(filter, ajax));
} else {
item = { field: filter.field, type: filter.type, value: filter.value };
if (ajax) {
if (typeof item.type == "function") {
item.type = "function";
}
}
output.push(item);
}
});
return output;
};
//get all filters
Filter.prototype.getHeaderFilters = function () {
var self = this,
output = [];
for (var key in this.headerFilters) {
output.push({ field: key, type: this.headerFilters[key].type, value: this.headerFilters[key].value });
}
return output;
};
//remove filter from array
Filter.prototype.removeFilter = function (field, type, value) {
var self = this;
if (!Array.isArray(field)) {
field = [{ field: field, type: type, value: value }];
}
field.forEach(function (filter) {
var index = -1;
if (_typeof(filter.field) == "object") {
index = self.filterList.findIndex(function (element) {
return filter === element;
});
} else {
index = self.filterList.findIndex(function (element) {
return filter.field === element.field && filter.type === element.type && filter.value === element.value;
});
}
if (index > -1) {
self.filterList.splice(index, 1);
self.changed = true;
} else {
console.warn("Filter Error - No matching filter type found, ignoring: ", filter.type);
}
});
if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) {
this.table.modules.persistence.save("filter");
}
};
//clear filters
Filter.prototype.clearFilter = function (all) {
this.filterList = [];
if (all) {
this.clearHeaderFilter();
}
this.changed = true;
if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.filter) {
this.table.modules.persistence.save("filter");
}
};
//clear header filters
Filter.prototype.clearHeaderFilter = function () {
var self = this;
this.headerFilters = {};
self.prevHeaderFilterChangeCheck = "{}";
this.headerFilterColumns.forEach(function (column) {
column.modules.filter.value = null;
column.modules.filter.prevSuccess = undefined;
self.reloadHeaderFilter(column);
});
this.changed = true;
};
//search data and return matching rows
Filter.prototype.search = function (searchType, field, type, value) {
var self = this,
activeRows = [],
filterList = [];
if (!Array.isArray(field)) {
field = [{ field: field, type: type, value: value }];
}
field.forEach(function (filter) {
filter = self.findFilter(filter);
if (filter) {
filterList.push(filter);
}
});
this.table.rowManager.rows.forEach(function (row) {
var match = true;
filterList.forEach(function (filter) {
if (!self.filterRecurse(filter, row.getData())) {
match = false;
}
});
if (match) {
activeRows.push(searchType === "data" ? row.getData("data") : row.getComponent());
}
});
return activeRows;
};
//filter row array
Filter.prototype.filter = function (rowList, filters) {
var self = this,
activeRows = [],
activeRowComponents = [];
if (self.table.options.dataFiltering) {
self.table.options.dataFiltering.call(self.table, self.getFilters());
}
if (!self.table.options.ajaxFiltering && (self.filterList.length || Object.keys(self.headerFilters).length)) {
rowList.forEach(function (row) {
if (self.filterRow(row)) {
activeRows.push(row);
}
});
} else {
activeRows = rowList.slice(0);
}
if (self.table.options.dataFiltered) {
activeRows.forEach(function (row) {
activeRowComponents.push(row.getComponent());
});
self.table.options.dataFiltered.call(self.table, self.getFilters(), activeRowComponents);
}
return activeRows;
};
//filter individual row
Filter.prototype.filterRow = function (row, filters) {
var self = this,
match = true,
data = row.getData();
self.filterList.forEach(function (filter) {
if (!self.filterRecurse(filter, data)) {
match = false;
}
});
for (var field in self.headerFilters) {
if (!self.headerFilters[field].func(data)) {
match = false;
}
}
return match;
};
Filter.prototype.filterRecurse = function (filter, data) {
var self = this,
match = false;
if (Array.isArray(filter)) {
filter.forEach(function (subFilter) {
if (self.filterRecurse(subFilter, data)) {
match = true;
}
});
} else {
match = filter.func(data);
}
return match;
};
//list of available filters
Filter.prototype.filters = {
//equal to
"=": function _(filterVal, rowVal, rowData, filterParams) {
return rowVal == filterVal ? true : false;
},
//less than
"<": function _(filterVal, rowVal, rowData, filterParams) {
return rowVal < filterVal ? true : false;
},
//less than or equal to
"<=": function _(filterVal, rowVal, rowData, filterParams) {
return rowVal <= filterVal ? true : false;
},
//greater than
">": function _(filterVal, rowVal, rowData, filterParams) {
return rowVal > filterVal ? true : false;
},
//greater than or equal to
">=": function _(filterVal, rowVal, rowData, filterParams) {
return rowVal >= filterVal ? true : false;
},
//not equal to
"!=": function _(filterVal, rowVal, rowData, filterParams) {
return rowVal != filterVal ? true : false;
},
"regex": function regex(filterVal, rowVal, rowData, filterParams) {
if (typeof filterVal == "string") {
filterVal = new RegExp(filterVal);
}
return filterVal.test(rowVal);
},
//contains the string
"like": function like(filterVal, rowVal, rowData, filterParams) {
if (filterVal === null || typeof filterVal === "undefined") {
return rowVal === filterVal ? true : false;
} else {
if (typeof rowVal !== 'undefined' && rowVal !== null) {
return String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;
} else {
return false;
}
}
},
//in array
"in": function _in(filterVal, rowVal, rowData, filterParams) {
if (Array.isArray(filterVal)) {
return filterVal.indexOf(rowVal) > -1;
} else {
console.warn("Filter Error - filter value is not an array:", filterVal);
return false;
}
}
};
Tabulator.prototype.registerModule("filter", Filter);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="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},Filter=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};Filter.prototype.initializeColumn=function(e,t){function r(t){var r,l="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",o="",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[n];else{switch(e.modules.filter.value=t,_typeof(e.definition.headerFilterFunc)){case"string":i.filters[e.definition.headerFilterFunc]?(o=e.definition.headerFilterFunc,r=function(r){var n=e.definition.headerFilterFuncParams||{},l=e.getFieldValue(r);return n="function"==typeof n?n(t,l,r):n,i.filters[e.definition.headerFilterFunc](t,l,r,n)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=function(r){var i=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(r);return i="function"==typeof i?i(t,n,r):i,e.definition.headerFilterFunc(t,n,r,i)},o=r}if(!r)switch(l){case"partial":r=function(r){var i=e.getFieldValue(r);return void 0!==i&&null!==i&&String(i).toLowerCase().indexOf(String(t).toLowerCase())>-1},o="like";break;default:r=function(r){return e.getFieldValue(r)==t},o="="}i.headerFilters[n]={value:t,func:r,type:o}}a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.changed=!0,i.table.rowManager.filterRefresh())}return!0}var i=this,n=e.getField();e.modules.filter={success:r,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},Filter.prototype.generateHeaderFilterElement=function(e,t,r){function i(){}var n,l,o,a,s,d,u,f=this,c=this,h=e.modules.filter.success,p=e.getField();if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),p){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},n=document.createElement("div"),n.classList.add("tabulator-header-filter"),_typeof(e.definition.headerFilter)){case"string":c.table.modules.edit.editors[e.definition.headerFilter]?(l=c.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":l=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?l=e.modules.edit.editor:e.definition.formatter&&c.table.modules.edit.editors[e.definition.formatter]?(l=c.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})):l=c.table.modules.edit.editors.input}if(l){if(a={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return n},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u=e.definition.headerFilterParams||{},u="function"==typeof u?u.call(c.table):u,!(o=l.call(this.table.modules.edit,a,function(){},h,i,u)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(o instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",o);p?c.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,function(e){o.setAttribute("placeholder",void 0!==e&&e?e:c.table.modules.localize.getText("headerFilters|default"))}):c.table.modules.localize.bind("headerFilters|default",function(e){o.setAttribute("placeholder",void 0!==c.column.definition.headerFilterPlaceholder&&c.column.definition.headerFilterPlaceholder?c.column.definition.headerFilterPlaceholder:e)}),o.addEventListener("click",function(e){e.stopPropagation(),o.focus()}),o.addEventListener("focus",function(e){var t=f.table.columnManager.element.scrollLeft;t!==f.table.rowManager.element.scrollLeft&&(f.table.rowManager.scrollHorizontal(t),f.table.columnManager.scrollHorizontal(t))}),s=!1,d=function(e){s&&clearTimeout(s),s=setTimeout(function(){h(o.value)},c.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=o,e.modules.filter.attrType=o.hasAttribute("type")?o.getAttribute("type").toLowerCase():"",e.modules.filter.Line truncated
+725
View File
@@ -0,0 +1,725 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Format = function Format(table) {
this.table = table; //hold Tabulator object
};
//initialize column formatter
Format.prototype.initializeColumn = function (column) {
column.modules.format = this.lookupFormatter(column, "");
if (typeof column.definition.formatterPrint !== "undefined") {
column.modules.format.print = this.lookupFormatter(column, "Print");
}
if (typeof column.definition.formatterClipboard !== "undefined") {
column.modules.format.clipboard = this.lookupFormatter(column, "Clipboard");
}
if (typeof column.definition.formatterHtmlOutput !== "undefined") {
column.modules.format.htmlOutput = this.lookupFormatter(column, "HtmlOutput");
}
};
Format.prototype.lookupFormatter = function (column, type) {
var config = { params: column.definition["formatter" + type + "Params"] || {} },
formatter = column.definition["formatter" + type];
//set column formatter
switch (typeof formatter === "undefined" ? "undefined" : _typeof(formatter)) {
case "string":
if (formatter === "tick") {
formatter = "tickCross";
if (typeof config.params.crossElement == "undefined") {
config.params.crossElement = false;
}
console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false");
}
if (this.formatters[formatter]) {
config.formatter = this.formatters[formatter];
} else {
console.warn("Formatter Error - No such formatter found: ", formatter);
config.formatter = this.formatters.plaintext;
}
break;
case "function":
config.formatter = formatter;
break;
default:
config.formatter = this.formatters.plaintext;
break;
}
return config;
};
Format.prototype.cellRendered = function (cell) {
if (cell.modules.format && cell.modules.format.renderedCallback) {
cell.modules.format.renderedCallback();
}
};
//return a formatted value for a cell
Format.prototype.formatValue = function (cell) {
var component = cell.getComponent(),
params = typeof cell.column.modules.format.params === "function" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;
function onRendered(callback) {
if (!cell.modules.format) {
cell.modules.format = {};
}
cell.modules.format.renderedCallback = callback;
}
return cell.column.modules.format.formatter.call(this, component, params, onRendered);
};
Format.prototype.formatExportValue = function (cell, type) {
var formatter = cell.column.modules.format[type],
params;
if (formatter) {
var onRendered = function onRendered(callback) {
if (!cell.modules.format) {
cell.modules.format = {};
}
cell.modules.format.renderedCallback = callback;
};
params = typeof formatter.params === "function" ? formatter.params(component) : formatter.params;
return formatter.formatter.call(this, cell.getComponent(), params, onRendered);
} else {
return this.formatValue(cell);
}
};
Format.prototype.sanitizeHTML = function (value) {
if (value) {
var entityMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
'/': '&#x2F;',
'`': '&#x60;',
'=': '&#x3D;'
};
return String(value).replace(/[&<>"'`=\/]/g, function (s) {
return entityMap[s];
});
} else {
return value;
}
};
Format.prototype.emptyToSpace = function (value) {
return value === null || typeof value === "undefined" || value === "" ? "&nbsp;" : value;
};
//get formatter for cell
Format.prototype.getFormatter = function (formatter) {
var formatter;
switch (typeof formatter === "undefined" ? "undefined" : _typeof(formatter)) {
case "string":
if (this.formatters[formatter]) {
formatter = this.formatters[formatter];
} else {
console.warn("Formatter Error - No such formatter found: ", formatter);
formatter = this.formatters.plaintext;
}
break;
case "function":
formatter = formatter;
break;
default:
formatter = this.formatters.plaintext;
break;
}
return formatter;
};
//default data formatters
Format.prototype.formatters = {
//plain text value
plaintext: function plaintext(cell, formatterParams, onRendered) {
return this.emptyToSpace(this.sanitizeHTML(cell.getValue()));
},
//html text value
html: function html(cell, formatterParams, onRendered) {
return cell.getValue();
},
//multiline text area
textarea: function textarea(cell, formatterParams, onRendered) {
cell.getElement().style.whiteSpace = "pre-wrap";
return this.emptyToSpace(this.sanitizeHTML(cell.getValue()));
},
//currency formatting
money: function money(cell, formatterParams, onRendered) {
var floatVal = parseFloat(cell.getValue()),
number,
integer,
decimal,
rgx;
var decimalSym = formatterParams.decimal || ".";
var thousandSym = formatterParams.thousand || ",";
var symbol = formatterParams.symbol || "";
var after = !!formatterParams.symbolAfter;
var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2;
if (isNaN(floatVal)) {
return this.emptyToSpace(this.sanitizeHTML(cell.getValue()));
}
number = precision !== false ? floatVal.toFixed(precision) : floatVal;
number = String(number).split(".");
integer = number[0];
decimal = number.length > 1 ? decimalSym + number[1] : "";
rgx = /(\d+)(\d{3})/;
while (rgx.test(integer)) {
integer = integer.replace(rgx, "$1" + thousandSym + "$2");
}
return after ? integer + decimal + symbol : symbol + integer + decimal;
},
//clickable anchor tag
link: function link(cell, formatterParams, onRendered) {
var value = cell.getValue(),
urlPrefix = formatterParams.urlPrefix || "",
download = formatterParams.download,
label = value,
el = document.createElement("a"),
data;
if (formatterParams.labelField) {
data = cell.getData();
label = data[formatterParams.labelField];
}
if (formatterParams.label) {
switch (_typeof(formatterParams.label)) {
case "string":
label = formatterParams.label;
break;
case "function":
label = formatterParams.label(cell);
break;
}
}
if (label) {
if (formatterParams.urlField) {
data = cell.getData();
value = data[formatterParams.urlField];
}
if (formatterParams.url) {
switch (_typeof(formatterParams.url)) {
case "string":
value = formatterParams.url;
break;
case "function":
value = formatterParams.url(cell);
break;
}
}
el.setAttribute("href", urlPrefix + value);
if (formatterParams.target) {
el.setAttribute("target", formatterParams.target);
}
if (formatterParams.download) {
if (typeof download == "function") {
download = download(cell);
} else {
download = download === true ? "" : download;
}
el.setAttribute("download", download);
}
el.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));
return el;
} else {
return "&nbsp;";
}
},
//image element
image: function image(cell, formatterParams, onRendered) {
var el = document.createElement("img");
el.setAttribute("src", cell.getValue());
switch (_typeof(formatterParams.height)) {
case "number":
el.style.height = formatterParams.height + "px";
break;
case "string":
el.style.height = formatterParams.height;
break;
}
switch (_typeof(formatterParams.width)) {
case "number":
el.style.width = formatterParams.width + "px";
break;
case "string":
el.style.width = formatterParams.width;
break;
}
el.addEventListener("load", function () {
cell.getRow().normalizeHeight();
});
return el;
},
//tick or cross
tickCross: function tickCross(cell, formatterParams, onRendered) {
var value = cell.getValue(),
element = cell.getElement(),
empty = formatterParams.allowEmpty,
truthy = formatterParams.allowTruthy,
tick = typeof formatterParams.tickElement !== "undefined" ? formatterParams.tickElement : '<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',
cross = typeof formatterParams.crossElement !== "undefined" ? formatterParams.crossElement : '<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';
if (truthy && value || value === true || value === "true" || value === "True" || value === 1 || value === "1") {
element.setAttribute("aria-checked", true);
return tick || "";
} else {
if (empty && (value === "null" || value === "" || value === null || typeof value === "undefined")) {
element.setAttribute("aria-checked", "mixed");
return "";
} else {
element.setAttribute("aria-checked", false);
return cross || "";
}
}
},
datetime: function datetime(cell, formatterParams, onRendered) {
var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss";
var outputFormat = formatterParams.outputFormat || "DD/MM/YYYY hh:mm:ss";
var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : "";
var value = cell.getValue();
var newDatetime = moment(value, inputFormat);
if (newDatetime.isValid()) {
return newDatetime.format(outputFormat);
} else {
if (invalid === true) {
return value;
} else if (typeof invalid === "function") {
return invalid(value);
} else {
return invalid;
}
}
},
datetimediff: function datetime(cell, formatterParams, onRendered) {
var inputFormat = formatterParams.inputFormat || "YYYY-MM-DD hh:mm:ss";
var invalid = typeof formatterParams.invalidPlaceholder !== "undefined" ? formatterParams.invalidPlaceholder : "";
var suffix = typeof formatterParams.suffix !== "undefined" ? formatterParams.suffix : false;
var unit = typeof formatterParams.unit !== "undefined" ? formatterParams.unit : undefined;
var humanize = typeof formatterParams.humanize !== "undefined" ? formatterParams.humanize : false;
var date = typeof formatterParams.date !== "undefined" ? formatterParams.date : moment();
var value = cell.getValue();
var newDatetime = moment(value, inputFormat);
if (newDatetime.isValid()) {
if (humanize) {
return moment.duration(newDatetime.diff(date)).humanize(suffix);
} else {
return newDatetime.diff(date, unit) + (suffix ? " " + suffix : "");
}
} else {
if (invalid === true) {
return value;
} else if (typeof invalid === "function") {
return invalid(value);
} else {
return invalid;
}
}
},
//select
lookup: function lookup(cell, formatterParams, onRendered) {
var value = cell.getValue();
if (typeof formatterParams[value] === "undefined") {
console.warn('Missing display value for ' + value);
return value;
}
return formatterParams[value];
},
//star rating
star: function star(cell, formatterParams, onRendered) {
var value = cell.getValue(),
element = cell.getElement(),
maxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,
stars = document.createElement("span"),
star = document.createElementNS('http://www.w3.org/2000/svg', "svg"),
starActive = '<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',
starInactive = '<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>';
//style stars holder
stars.style.verticalAlign = "middle";
//style star
star.setAttribute("width", "14");
star.setAttribute("height", "14");
star.setAttribute("viewBox", "0 0 512 512");
star.setAttribute("xml:space", "preserve");
star.style.padding = "0 1px";
value = value && !isNaN(value) ? parseInt(value) : 0;
value = Math.max(0, Math.min(value, maxStars));
for (var i = 1; i <= maxStars; i++) {
var nextStar = star.cloneNode(true);
nextStar.innerHTML = i <= value ? starActive : starInactive;
stars.appendChild(nextStar);
}
element.style.whiteSpace = "nowrap";
element.style.overflow = "hidden";
element.style.textOverflow = "ellipsis";
element.setAttribute("aria-label", value);
return stars;
},
traffic: function traffic(cell, formatterParams, onRendered) {
var value = this.sanitizeHTML(cell.getValue()) || 0,
el = document.createElement("span"),
max = formatterParams && formatterParams.max ? formatterParams.max : 100,
min = formatterParams && formatterParams.min ? formatterParams.min : 0,
colors = formatterParams && typeof formatterParams.color !== "undefined" ? formatterParams.color : ["red", "orange", "green"],
color = "#666666",
percent,
percentValue;
if (isNaN(value) || typeof cell.getValue() === "undefined") {
return;
}
el.classList.add("tabulator-traffic-light");
//make sure value is in range
percentValue = parseFloat(value) <= max ? parseFloat(value) : max;
percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;
//workout percentage
percent = (max - min) / 100;
percentValue = Math.round((percentValue - min) / percent);
//set color
switch (typeof colors === "undefined" ? "undefined" : _typeof(colors)) {
case "string":
color = colors;
break;
case "function":
color = colors(value);
break;
case "object":
if (Array.isArray(colors)) {
var unit = 100 / colors.length;
var index = Math.floor(percentValue / unit);
index = Math.min(index, colors.length - 1);
index = Math.max(index, 0);
color = colors[index];
break;
}
}
el.style.backgroundColor = color;
return el;
},
//progress bar
progress: function progress(cell, formatterParams, onRendered) {
//progress bar
var value = this.sanitizeHTML(cell.getValue()) || 0,
element = cell.getElement(),
max = formatterParams && formatterParams.max ? formatterParams.max : 100,
min = formatterParams && formatterParams.min ? formatterParams.min : 0,
legendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : "center",
percent,
percentValue,
color,
legend,
legendColor,
top,
left,
right,
bottom;
//make sure value is in range
percentValue = parseFloat(value) <= max ? parseFloat(value) : max;
percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;
//workout percentage
percent = (max - min) / 100;
percentValue = Math.round((percentValue - min) / percent);
//set bar color
switch (_typeof(formatterParams.color)) {
case "string":
color = formatterParams.color;
break;
case "function":
color = formatterParams.color(value);
break;
case "object":
if (Array.isArray(formatterParams.color)) {
var unit = 100 / formatterParams.color.length;
var index = Math.floor(percentValue / unit);
index = Math.min(index, formatterParams.color.length - 1);
index = Math.max(index, 0);
color = formatterParams.color[index];
break;
}
default:
color = "#2DC214";
}
//generate legend
switch (_typeof(formatterParams.legend)) {
case "string":
legend = formatterParams.legend;
break;
case "function":
legend = formatterParams.legend(value);
break;
case "boolean":
legend = value;
break;
default:
legend = false;
}
//set legend color
switch (_typeof(formatterParams.legendColor)) {
case "string":
legendColor = formatterParams.legendColor;
break;
case "function":
legendColor = formatterParams.legendColor(value);
break;
case "object":
if (Array.isArray(formatterParams.legendColor)) {
var unit = 100 / formatterParams.legendColor.length;
var index = Math.floor(percentValue / unit);
index = Math.min(index, formatterParams.legendColor.length - 1);
index = Math.max(index, 0);
legendColor = formatterParams.legendColor[index];
}
break;
default:
legendColor = "#000";
}
element.style.minWidth = "30px";
element.style.position = "relative";
element.setAttribute("aria-label", percentValue);
var barEl = document.createElement("div");
barEl.style.display = "inline-block";
barEl.style.position = "relative";
barEl.style.width = percentValue + "%";
barEl.style.backgroundColor = color;
barEl.style.height = "100%";
barEl.setAttribute('data-max', max);
barEl.setAttribute('data-min', min);
if (legend) {
var legendEl = document.createElement("div");
legendEl.style.position = "absolute";
legendEl.style.top = "4px";
legendEl.style.left = 0;
legendEl.style.textAlign = legendAlign;
legendEl.style.width = "100%";
legendEl.style.color = legendColor;
legendEl.innerHTML = legend;
}
onRendered(function () {
//handle custom element needed if formatter is to be included in printed/downloaded output
if (!(cell instanceof CellComponent)) {
var holderEl = document.createElement("div");
holderEl.style.position = "absolute";
holderEl.style.top = "4px";
holderEl.style.bottom = "4px";
holderEl.style.left = "4px";
holderEl.style.right = "4px";
element.appendChild(holderEl);
element = holderEl;
}
element.appendChild(barEl);
if (legend) {
element.appendChild(legendEl);
}
});
return "";
},
//background color
color: function color(cell, formatterParams, onRendered) {
cell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());
return "";
},
//tick icon
buttonTick: function buttonTick(cell, formatterParams, onRendered) {
return '<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>';
},
//cross icon
buttonCross: function buttonCross(cell, formatterParams, onRendered) {
return '<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';
},
//current row number
rownum: function rownum(cell, formatterParams, onRendered) {
return this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1;
},
//row handle
handle: function handle(cell, formatterParams, onRendered) {
cell.getElement().classList.add("tabulator-row-handle");
return "<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>";
},
responsiveCollapse: function responsiveCollapse(cell, formatterParams, onRendered) {
var self = this,
open = false,
el = document.createElement("div"),
config = cell.getRow()._row.modules.responsiveLayout;
el.classList.add("tabulator-responsive-collapse-toggle");
el.innerHTML = "<span class='tabulator-responsive-collapse-toggle-open'>+</span><span class='tabulator-responsive-collapse-toggle-close'>-</span>";
cell.getElement().classList.add("tabulator-row-handle");
function toggleList(isOpen) {
var collapseEl = config.element;
config.open = isOpen;
if (collapseEl) {
if (config.open) {
el.classList.add("open");
collapseEl.style.display = '';
} else {
el.classList.remove("open");
collapseEl.style.display = 'none';
}
}
}
el.addEventListener("click", function (e) {
e.stopImmediatePropagation();
toggleList(!config.open);
});
toggleList(config.open);
return el;
},
rowSelection: function rowSelection(cell) {
var _this = this;
var checkbox = document.createElement("input");
checkbox.type = 'checkbox';
if (this.table.modExists("selectRow", true)) {
checkbox.addEventListener("click", function (e) {
e.stopPropagation();
});
if (typeof cell.getRow == 'function') {
var row = cell.getRow();
checkbox.addEventListener("change", function (e) {
row.toggleSelect();
});
checkbox.checked = row.isSelected();
this.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);
} else {
checkbox.addEventListener("change", function (e) {
if (_this.table.modules.selectRow.selectedRows.length) {
_this.table.deselectRow();
} else {
_this.table.selectRow();
}
});
this.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);
}
}
return checkbox;
}
};
Tabulator.prototype.registerModule("format", Format);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="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},Format=function(e){this.table=e};Format.prototype.initializeColumn=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"))},Format.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},r=e.definition["formatter"+t];switch(void 0===r?"undefined":_typeof(r)){case"string":"tick"===r&&(r="tickCross",void 0===o.params.crossElement&&(o.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[r]?o.formatter=this.formatters[r]:(console.warn("Formatter Error - No such formatter found: ",r),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=r;break;default:o.formatter=this.formatters.plaintext}return o},Format.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},Format.prototype.formatValue=function(e){function t(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}var o=e.getComponent(),r="function"==typeof e.column.modules.format.params?e.column.modules.format.params(o):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,o,r,t)},Format.prototype.formatExportValue=function(e,t){var o,r=e.column.modules.format[t];if(r){var a=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"==typeof r.params?r.params(component):r.params,r.formatter.call(this,e.getComponent(),o,a)}return this.formatValue(e)},Format.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},Format.prototype.emptyToSpace=function(e){return null===e||void 0===e||""===e?"&nbsp;":e},Format.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},Format.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var r,a,l,n,i=parseFloat(e.getValue()),s=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,m=void 0!==t.precision?t.precision:2;if(isNaN(i))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(r=!1!==m?i.toFixed(m):i,r=String(r).split("."),a=r[0],l=r.length>1?s+r[1]:"",n=/(\d+)(\d{3})/;n.test(a);)a=a.replace(n,"$1"+c+"$2");return d?a+l+u:u+a+l},link:function(e,t,o){var r,a=e.getValue(),l=t.urlPrefix||"",n=t.download,i=a,s=document.createElement("a");if(t.labelField&&(r=e.getData(),i=r[t.labelField]),t.label)switch(_typeof(t.label)){case"string":i=t.label;break;case"function":i=t.label(e)}if(i){if(t.urlField&&(r=e.getData(),a=r[t.urlField]),t.url)switch(_typeof(t.url)){case"string":a=t.url;break;case"function":a=t.url(e)}return s.setAttribute("href",l+a),t.target&&s.setAttribute("target",t.target),t.download&&(n="function"==typeof n?n(e):!0===n?"":n,s.setAttribute("download",n)),s.innerHTML=this.emptyToSpace(this.sanitizeHTML(i)),s}return"&nbsp;"},image:function(e,t,o){var r=document.createElement("img");switch(r.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":r.style.height=t.height+"px";break;case"string":r.style.height=t.height}switch(_typeof(t.width)){case"number":r.style.width=t.width+"px";break;case"string":r.style.width=t.width}return r.addEventListener("load",function(){e.getRow().normalizeHeight()}),r},tickCross:function(e,t,o){var r=e.getValue(),a=e.getElement(),l=t.allowEmpty,n=t.allowTruthy,i=void 0!==t.tickElement?t.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.Line truncated
@@ -0,0 +1,275 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var FrozenColumns = function FrozenColumns(table) {
this.table = table; //hold Tabulator object
this.leftColumns = [];
this.rightColumns = [];
this.leftMargin = 0;
this.rightMargin = 0;
this.rightPadding = 0;
this.initializationMode = "left";
this.active = false;
this.scrollEndTimer = false;
};
//reset initial state
FrozenColumns.prototype.reset = function () {
this.initializationMode = "left";
this.leftColumns = [];
this.rightColumns = [];
this.leftMargin = 0;
this.rightMargin = 0;
this.rightMargin = 0;
this.active = false;
this.table.columnManager.headersElement.style.marginLeft = 0;
this.table.columnManager.element.style.paddingRight = 0;
};
//initialize specific column
FrozenColumns.prototype.initializeColumn = function (column) {
var config = { margin: 0, edge: false };
if (!column.isGroup) {
if (this.frozenCheck(column)) {
config.position = this.initializationMode;
if (this.initializationMode == "left") {
this.leftColumns.push(column);
} else {
this.rightColumns.unshift(column);
}
this.active = true;
column.modules.frozen = config;
} else {
this.initializationMode = "right";
}
}
};
FrozenColumns.prototype.frozenCheck = function (column) {
var frozen = false;
if (column.parent.isGroup && column.definition.frozen) {
console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups");
}
if (column.parent.isGroup) {
return this.frozenCheck(column.parent);
} else {
return column.definition.frozen;
}
return frozen;
};
//quick layout to smooth horizontal scrolling
FrozenColumns.prototype.scrollHorizontal = function () {
var _this = this;
var rows;
if (this.active) {
clearTimeout(this.scrollEndTimer);
//layout all rows after scroll is complete
this.scrollEndTimer = setTimeout(function () {
_this.layout();
}, 100);
rows = this.table.rowManager.getVisibleRows();
this.calcMargins();
this.layoutColumnPosition();
this.layoutCalcRows();
rows.forEach(function (row) {
if (row.type === "row") {
_this.layoutRow(row);
}
});
this.table.rowManager.tableElement.style.marginRight = this.rightMargin;
}
};
//calculate margins for rows
FrozenColumns.prototype.calcMargins = function () {
this.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + "px";
this.table.columnManager.headersElement.style.marginLeft = this.leftMargin;
this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px";
this.table.columnManager.element.style.paddingRight = this.rightMargin;
//calculate right frozen columns
this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;
};
//layout calculation rows
FrozenColumns.prototype.layoutCalcRows = function () {
if (this.table.modExists("columnCalcs")) {
if (this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow) {
this.layoutRow(this.table.modules.columnCalcs.topRow);
}
if (this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow) {
this.layoutRow(this.table.modules.columnCalcs.botRow);
}
}
};
//calculate column positions and layout headers
FrozenColumns.prototype.layoutColumnPosition = function (allCells) {
var _this2 = this;
var leftParents = [];
this.leftColumns.forEach(function (column, i) {
column.modules.frozen.margin = _this2._calcSpace(_this2.leftColumns, i) + _this2.table.columnManager.scrollLeft + "px";
if (i == _this2.leftColumns.length - 1) {
column.modules.frozen.edge = true;
} else {
column.modules.frozen.edge = false;
}
if (column.parent.isGroup) {
var parentEl = _this2.getColGroupParentElement(column);
if (!leftParents.includes(parentEl)) {
_this2.layoutElement(parentEl, column);
leftParents.push(parentEl);
}
if (column.modules.frozen.edge) {
parentEl.classList.add("tabulator-frozen-" + column.modules.frozen.position);
}
} else {
_this2.layoutElement(column.getElement(), column);
}
if (allCells) {
column.cells.forEach(function (cell) {
_this2.layoutElement(cell.getElement(), column);
});
}
});
this.rightColumns.forEach(function (column, i) {
column.modules.frozen.margin = _this2.rightPadding - _this2._calcSpace(_this2.rightColumns, i + 1) + "px";
if (i == _this2.rightColumns.length - 1) {
column.modules.frozen.edge = true;
} else {
column.modules.frozen.edge = false;
}
if (column.parent.isGroup) {
_this2.layoutElement(_this2.getColGroupParentElement(column), column);
} else {
_this2.layoutElement(column.getElement(), column);
}
if (allCells) {
column.cells.forEach(function (cell) {
_this2.layoutElement(cell.getElement(), column);
});
}
});
};
FrozenColumns.prototype.getColGroupParentElement = function (column) {
return column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();
};
//layout columns appropropriatly
FrozenColumns.prototype.layout = function () {
var self = this,
rightMargin = 0;
if (self.active) {
//calculate row padding
this.calcMargins();
// self.table.rowManager.activeRows.forEach(function(row){
// self.layoutRow(row);
// });
// if(self.table.options.dataTree){
self.table.rowManager.getDisplayRows().forEach(function (row) {
if (row.type === "row") {
self.layoutRow(row);
}
});
// }
this.layoutCalcRows();
//calculate left columns
this.layoutColumnPosition(true);
// if(tableHolder.scrollHeight > tableHolder.clientHeight){
// rightMargin -= tableHolder.offsetWidth - tableHolder.clientWidth;
// }
this.table.rowManager.tableElement.style.marginRight = this.rightMargin;
}
};
FrozenColumns.prototype.layoutRow = function (row) {
var _this3 = this;
var rowEl = row.getElement();
rowEl.style.paddingLeft = this.leftMargin;
// rowEl.style.paddingRight = this.rightMargin + "px";
this.leftColumns.forEach(function (column) {
var cell = row.getCell(column);
if (cell) {
_this3.layoutElement(cell.getElement(), column);
}
});
this.rightColumns.forEach(function (column) {
var cell = row.getCell(column);
if (cell) {
_this3.layoutElement(cell.getElement(), column);
}
});
};
FrozenColumns.prototype.layoutElement = function (element, column) {
if (column.modules.frozen) {
element.style.position = "absolute";
element.style.left = column.modules.frozen.margin;
element.classList.add("tabulator-frozen");
if (column.modules.frozen.edge) {
element.classList.add("tabulator-frozen-" + column.modules.frozen.position);
}
}
};
FrozenColumns.prototype._calcSpace = function (columns, index) {
var width = 0;
for (var i = 0; i < index; i++) {
if (columns[i].visible) {
width += columns[i].getWidth();
}
}
return width;
};
Tabulator.prototype.registerModule("frozenColumns", FrozenColumns);
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var FrozenColumns=function(t){this.table=t,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};FrozenColumns.prototype.reset=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},FrozenColumns.prototype.initializeColumn=function(t){var e={margin:0,edge:!1};t.isGroup||(this.frozenCheck(t)?(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=e):this.initializationMode="right")},FrozenColumns.prototype.frozenCheck=function(t){return t.parent.isGroup&&t.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),t.parent.isGroup?this.frozenCheck(t.parent):t.definition.frozen},FrozenColumns.prototype.scrollHorizontal=function(){var t,e=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){e.layout()},100),t=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),t.forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},FrozenColumns.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft},FrozenColumns.prototype.layoutCalcRows=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))},FrozenColumns.prototype.layoutColumnPosition=function(t){var e=this,o=[];this.leftColumns.forEach(function(n,l){if(n.modules.frozen.margin=e._calcSpace(e.leftColumns,l)+e.table.columnManager.scrollLeft+"px",l==e.leftColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,n.parent.isGroup){var i=e.getColGroupParentElement(n);o.includes(i)||(e.layoutElement(i,n),o.push(i)),n.modules.frozen.edge&&i.classList.add("tabulator-frozen-"+n.modules.frozen.position)}else e.layoutElement(n.getElement(),n);t&&n.cells.forEach(function(t){e.layoutElement(t.getElement(),n)})}),this.rightColumns.forEach(function(o,n){o.modules.frozen.margin=e.rightPadding-e._calcSpace(e.rightColumns,n+1)+"px",n==e.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?e.layoutElement(e.getColGroupParentElement(o),o):e.layoutElement(o.getElement(),o),t&&o.cells.forEach(function(t){e.layoutElement(t.getElement(),o)})})},FrozenColumns.prototype.getColGroupParentElement=function(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()},FrozenColumns.prototype.layout=function(){var t=this;t.active&&(this.calcMargins(),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},FrozenColumns.prototype.layoutRow=function(t){var e=this;t.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var n=t.getCell(o);n&&e.layoutElement(n.getElement(),o)}),this.rightColumns.forEach(function(o){var n=t.getCell(o);n&&e.layoutElement(n.getElement(),o)})},FrozenColumns.prototype.layoutElement=function(t,e){e.modules.frozen&&(t.style.position="absolute",t.style.left=e.modules.frozen.margin,t.classList.add("tabulator-frozen"),e.modules.frozen.edge&&t.classList.add("tabulator-frozen-"+e.modules.frozen.position))},FrozenColumns.prototype._calcSpace=function(t,e){for(var o=0,n=0;n<e;n++)t[n].visible&&(o+=t[n].getWidth());return o},Tabulator.prototype.registerModule("frozenColumns",FrozenColumns);
@@ -0,0 +1,98 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var FrozenRows = function FrozenRows(table) {
this.table = table; //hold Tabulator object
this.topElement = document.createElement("div");
this.rows = [];
this.displayIndex = 0; //index in display pipeline
};
FrozenRows.prototype.initialize = function () {
this.rows = [];
this.topElement.classList.add("tabulator-frozen-rows-holder");
// this.table.columnManager.element.append(this.topElement);
this.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);
};
FrozenRows.prototype.setDisplayIndex = function (index) {
this.displayIndex = index;
};
FrozenRows.prototype.getDisplayIndex = function () {
return this.displayIndex;
};
FrozenRows.prototype.isFrozen = function () {
return !!this.rows.length;
};
//filter frozen rows out of display data
FrozenRows.prototype.getRows = function (rows) {
var self = this,
frozen = [],
output = rows.slice(0);
this.rows.forEach(function (row) {
var index = output.indexOf(row);
if (index > -1) {
output.splice(index, 1);
}
});
return output;
};
FrozenRows.prototype.freezeRow = function (row) {
if (!row.modules.frozen) {
row.modules.frozen = true;
this.topElement.appendChild(row.getElement());
row.initialize();
row.normalizeHeight();
this.table.rowManager.adjustTableSize();
this.rows.push(row);
this.table.rowManager.refreshActiveData("display");
this.styleRows();
} else {
console.warn("Freeze Error - Row is already frozen");
}
};
FrozenRows.prototype.unfreezeRow = function (row) {
var index = this.rows.indexOf(row);
if (row.modules.frozen) {
row.modules.frozen = false;
var rowEl = row.getElement();
rowEl.parentNode.removeChild(rowEl);
this.table.rowManager.adjustTableSize();
this.rows.splice(index, 1);
this.table.rowManager.refreshActiveData("display");
if (this.rows.length) {
this.styleRows();
}
} else {
console.warn("Freeze Error - Row is already unfrozen");
}
};
FrozenRows.prototype.styleRows = function (row) {
var self = this;
this.rows.forEach(function (row, i) {
self.table.rowManager.styleRow(row, i);
});
};
Tabulator.prototype.registerModule("frozenRows", FrozenRows);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var FrozenRows=function(e){this.table=e,this.topElement=document.createElement("div"),this.rows=[],this.displayIndex=0};FrozenRows.prototype.initialize=function(){this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling)},FrozenRows.prototype.setDisplayIndex=function(e){this.displayIndex=e},FrozenRows.prototype.getDisplayIndex=function(){return this.displayIndex},FrozenRows.prototype.isFrozen=function(){return!!this.rows.length},FrozenRows.prototype.getRows=function(e){var o=e.slice(0);return this.rows.forEach(function(e){var t=o.indexOf(e);t>-1&&o.splice(t,1)}),o},FrozenRows.prototype.freezeRow=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.table.rowManager.refreshActiveData("display"),this.styleRows())},FrozenRows.prototype.unfreezeRow=function(e){var o=this.rows.indexOf(e);if(e.modules.frozen){e.modules.frozen=!1;var t=e.getElement();t.parentNode.removeChild(t),this.table.rowManager.adjustTableSize(),this.rows.splice(o,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},FrozenRows.prototype.styleRows=function(e){var o=this;this.rows.forEach(function(e,t){o.table.rowManager.styleRow(e,t)})},Tabulator.prototype.registerModule("frozenRows",FrozenRows);
File diff suppressed because it is too large. Load diff
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var GroupComponent=function(t){this._group=t,this.type="GroupComponent"};GroupComponent.prototype.getKey=function(){return this._group.key},GroupComponent.prototype.getField=function(){return this._group.field},GroupComponent.prototype.getElement=function(){return this._group.element},GroupComponent.prototype.getRows=function(){return this._group.getRows(!0)},GroupComponent.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},GroupComponent.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},GroupComponent.prototype.getVisibility=function(){return this._group.visible},GroupComponent.prototype.show=function(){this._group.show()},GroupComponent.prototype.hide=function(){this._group.hide()},GroupComponent.prototype.toggle=function(){this._group.toggleVisibility()},GroupComponent.prototype._getSelf=function(){return this._group},GroupComponent.prototype.getTable=function(){return this._group.groupManager.table};var Group=function(t,o,e,r,i,s,n){this.groupManager=t,this.parent=o,this.key=r,this.level=e,this.field=i,this.hasSubGroups=e<t.groupIDLookups.length-1,this.addRow=this.hasSubGroups?this._addRowToGroup:this._addRow,this.type="group",this.old=n,this.rows=[],this.groups=[],this.groupList=[],this.generator=s,this.elementContents=!1,this.height=0,this.outerHeight=0,this.initialized=!1,this.calcs={},this.initialized=!1,this.modules={},this.arrowElement=!1,this.visible=n?n.visible:void 0!==t.startOpen[e]?t.startOpen[e]:t.startOpen[0],this.createElements(),this.addBindings(),this.createValueGroups()};Group.prototype.wipe=function(){this.groupList.length?this.groupList.forEach(function(t){t.wipe()}):(this.element=!1,this.arrowElement=!1,this.elementContents=!1)},Group.prototype.createElements=function(){var t=document.createElement("div");t.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(t),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)},Group.prototype.createValueGroups=function(){var t=this,o=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[o]&&this.groupManager.allowedValues[o].forEach(function(e){t._createGroup(e,o)})},Group.prototype.addBindings=function(){var t,o,e,r,i=this;i.groupManager.table.options.groupClick&&i.element.addEventListener("click",function(t){i.groupManager.table.options.groupClick.call(i.groupManager.table,t,i.getComponent())}),i.groupManager.table.options.groupDblClick&&i.element.addEventListener("dblclick",function(t){i.groupManager.table.options.groupDblClick.call(i.groupManager.table,t,i.getComponent())}),i.groupManager.table.options.groupContext&&i.element.addEventListener("contextmenu",function(t){i.groupManager.table.options.groupContext.call(i.groupManager.table,t,i.getComponent())}),i.groupManager.table.options.groupTap&&(e=!1,i.element.addEventListener("touchstart",function(t){e=!0},{passive:!0}),i.element.addEventListener("touchend",function(t){e&&i.groupManager.table.options.groupTap(t,i.getComponent()),e=!1})),i.groupManager.table.options.groupDblTap&&(t=null,i.element.addEventListener("touchend",function(o){t?(clearTimeout(t),t=null,i.groupManager.table.options.groupDblTap(o,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.groupManager.table.options.groupTapHold&&(o=null,i.element.addEventListener("touchstart",function(t){clearTimeout(o),o=setTimeout(function(){clearTimeout(o),o=null,e=!1,i.groupManager.table.options.groupTapHold(t,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(t){clearTimeout(o),o=null})),i.groupManager.table.options.groupToggleElement&&(r="arrow"==i.groupManager.table.options.groupToggleElement?i.arrowElement:i.element,r.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),i.toggleVisibility()}))},Group.prototype._createGroup=function(t,o){var e=o+"_"+t,r=new Group(this.groupManager,this,o,t,this.groupManager.groupIDLookups[o].field,this.groupManager.headerGenerator[o]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[e]);this.groups[e]=r,this.groupList.push(r)},Group.prototype._addRowToGroup=function(t){var o=this.level+1;if(this.hasSubGroups){var e=this.groupManager.groupIDLookups[o].func(t.getData()),r=o+"_"+e;this.groupManager.allowedValues&&this.groupManager.allowedValues[o]?this.groups[r]&&this.groups[r].addRow(t):(this.groups[r]||this._createGroup(e,o),this.groups[r].addRow(t))}},Group.prototype._addRow=function(t){this.rows.push(t),t.modules.group=this},Group.prototype.iLine truncated
@@ -0,0 +1,141 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var History = function History(table) {
this.table = table; //hold Tabulator object
this.history = [];
this.index = -1;
};
History.prototype.clear = function () {
this.history = [];
this.index = -1;
};
History.prototype.action = function (type, component, data) {
this.history = this.history.slice(0, this.index + 1);
this.history.push({
type: type,
component: component,
data: data
});
this.index++;
};
History.prototype.getHistoryUndoSize = function () {
return this.index + 1;
};
History.prototype.getHistoryRedoSize = function () {
return this.history.length - (this.index + 1);
};
History.prototype.undo = function () {
if (this.index > -1) {
var action = this.history[this.index];
this.undoers[action.type].call(this, action);
this.index--;
this.table.options.historyUndo.call(this.table, action.type, action.component.getComponent(), action.data);
return true;
} else {
console.warn("History Undo Error - No more history to undo");
return false;
}
};
History.prototype.redo = function () {
if (this.history.length - 1 > this.index) {
this.index++;
var action = this.history[this.index];
this.redoers[action.type].call(this, action);
this.table.options.historyRedo.call(this.table, action.type, action.component.getComponent(), action.data);
return true;
} else {
console.warn("History Redo Error - No more history to redo");
return false;
}
};
History.prototype.undoers = {
cellEdit: function cellEdit(action) {
action.component.setValueProcessData(action.data.oldValue);
},
rowAdd: function rowAdd(action) {
action.component.deleteActual();
},
rowDelete: function rowDelete(action) {
var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);
if (this.table.options.groupBy && this.table.modExists("groupRows")) {
this.table.modules.groupRows.updateGroupRows(true);
}
this._rebindRow(action.component, newRow);
},
rowMove: function rowMove(action) {
this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);
this.table.rowManager.redraw();
}
};
History.prototype.redoers = {
cellEdit: function cellEdit(action) {
action.component.setValueProcessData(action.data.newValue);
},
rowAdd: function rowAdd(action) {
var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);
if (this.table.options.groupBy && this.table.modExists("groupRows")) {
this.table.modules.groupRows.updateGroupRows(true);
}
this._rebindRow(action.component, newRow);
},
rowDelete: function rowDelete(action) {
action.component.deleteActual();
},
rowMove: function rowMove(action) {
this.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);
this.table.rowManager.redraw();
}
};
//rebind rows to new element after deletion
History.prototype._rebindRow = function (oldRow, newRow) {
this.history.forEach(function (action) {
if (action.component instanceof Row) {
if (action.component === oldRow) {
action.component = newRow;
}
} else if (action.component instanceof Cell) {
if (action.component.row === oldRow) {
var field = action.component.column.getField();
if (field) {
action.component = newRow.getCell(field);
}
}
}
});
};
Tabulator.prototype.registerModule("history", History);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var History=function(t){this.table=t,this.history=[],this.index=-1};History.prototype.clear=function(){this.history=[],this.index=-1},History.prototype.action=function(t,o,e){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:o,data:e}),this.index++},History.prototype.getHistoryUndoSize=function(){return this.index+1},History.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},History.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},History.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},History.prototype.undoers={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue)},rowAdd:function(t){t.component.deleteActual()},rowDelete:function(t){var o=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,o)},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.posFrom],!t.data.after),this.table.rowManager.redraw()}},History.prototype.redoers={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue)},rowAdd:function(t){var o=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,o)},rowDelete:function(t){t.component.deleteActual()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.posTo],t.data.after),this.table.rowManager.redraw()}},History.prototype._rebindRow=function(t,o){this.history.forEach(function(e){if(e.component instanceof Row)e.component===t&&(e.component=o);else if(e.component instanceof Cell&&e.component.row===t){var i=e.component.column.getField();i&&(e.component=o.getCell(i))}})},Tabulator.prototype.registerModule("history",History);
@@ -0,0 +1,191 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var HtmlTableImport = function HtmlTableImport(table) {
this.table = table; //hold Tabulator object
this.fieldIndex = [];
this.hasIndex = false;
};
HtmlTableImport.prototype.parseTable = function () {
var self = this,
element = self.table.element,
options = self.table.options,
columns = options.columns,
headers = element.getElementsByTagName("th"),
rows = element.getElementsByTagName("tbody")[0],
data = [],
newTable;
self.hasIndex = false;
self.table.options.htmlImporting.call(this.table);
rows = rows ? rows.getElementsByTagName("tr") : [];
//check for tablator inline options
self._extractOptions(element, options);
if (headers.length) {
self._extractHeaders(headers, rows);
} else {
self._generateBlankHeaders(headers, rows);
}
//iterate through table rows and build data set
for (var index = 0; index < rows.length; index++) {
var row = rows[index],
cells = row.getElementsByTagName("td"),
item = {};
//create index if the dont exist in table
if (!self.hasIndex) {
item[options.index] = index;
}
for (var i = 0; i < cells.length; i++) {
var cell = cells[i];
if (typeof this.fieldIndex[i] !== "undefined") {
item[this.fieldIndex[i]] = cell.innerHTML;
}
}
//add row data to item
data.push(item);
}
//create new element
var newElement = document.createElement("div");
//transfer attributes to new element
var attributes = element.attributes;
// loop through attributes and apply them on div
for (var i in attributes) {
if (_typeof(attributes[i]) == "object") {
newElement.setAttribute(attributes[i].name, attributes[i].value);
}
}
// replace table with div element
element.parentNode.replaceChild(newElement, element);
options.data = data;
self.table.options.htmlImported.call(this.table);
// // newElement.tabulator(options);
this.table.element = newElement;
};
//extract tabulator attribute options
HtmlTableImport.prototype._extractOptions = function (element, options, defaultOptions) {
var attributes = element.attributes;
var optionsArr = defaultOptions ? Object.assign([], defaultOptions) : Object.keys(options);
var optionsList = {};
optionsArr.forEach(function (item) {
optionsList[item.toLowerCase()] = item;
});
for (var index in attributes) {
var attrib = attributes[index];
var name;
if (attrib && (typeof attrib === "undefined" ? "undefined" : _typeof(attrib)) == "object" && attrib.name && attrib.name.indexOf("tabulator-") === 0) {
name = attrib.name.replace("tabulator-", "");
if (typeof optionsList[name] !== "undefined") {
options[optionsList[name]] = this._attribValue(attrib.value);
}
}
}
};
//get value of attribute
HtmlTableImport.prototype._attribValue = function (value) {
if (value === "true") {
return true;
}
if (value === "false") {
return false;
}
return value;
};
//find column if it has already been defined
HtmlTableImport.prototype._findCol = function (title) {
var match = this.table.options.columns.find(function (column) {
return column.title === title;
});
return match || false;
};
//extract column from headers
HtmlTableImport.prototype._extractHeaders = function (headers, rows) {
for (var index = 0; index < headers.length; index++) {
var header = headers[index],
exists = false,
col = this._findCol(header.textContent),
width,
attributes;
if (col) {
exists = true;
} else {
col = { title: header.textContent.trim() };
}
if (!col.field) {
col.field = header.textContent.trim().toLowerCase().replace(" ", "_");
}
width = header.getAttribute("width");
if (width && !col.width) {
col.width = width;
}
//check for tablator inline options
attributes = header.attributes;
// //check for tablator inline options
this._extractOptions(header, col, Column.prototype.defaultOptionList);
this.fieldIndex[index] = col.field;
if (col.field == this.table.options.index) {
this.hasIndex = true;
}
if (!exists) {
this.table.options.columns.push(col);
}
}
};
//generate blank headers
HtmlTableImport.prototype._generateBlankHeaders = function (headers, rows) {
for (var index = 0; index < headers.length; index++) {
var header = headers[index],
col = { title: "", field: "col" + index };
this.fieldIndex[index] = col.field;
var width = header.getAttribute("width");
if (width) {
col.width = width;
}
this.table.options.columns.push(col);
}
};
Tabulator.prototype.registerModule("htmlTableImport", HtmlTableImport);
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HtmlTableImport=function(t){this.table=t,this.fieldIndex=[],this.hasIndex=!1};HtmlTableImport.prototype.parseTable=function(){var t=this,e=t.table.element,o=t.table.options,a=(o.columns,e.getElementsByTagName("th")),n=e.getElementsByTagName("tbody")[0],l=[];t.hasIndex=!1,t.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],t._extractOptions(e,o),a.length?t._extractHeaders(a,n):t._generateBlankHeaders(a,n);for(var r=0;r<n.length;r++){var i=n[r],s=i.getElementsByTagName("td"),p={};t.hasIndex||(p[o.index]=r);for(var m=0;m<s.length;m++){var d=s[m];void 0!==this.fieldIndex[m]&&(p[this.fieldIndex[m]]=d.innerHTML)}l.push(p)}var f=document.createElement("div"),b=e.attributes;for(var m in b)"object"==_typeof(b[m])&&f.setAttribute(b[m].name,b[m].value);e.parentNode.replaceChild(f,e),o.data=l,t.table.options.htmlImported.call(this.table),this.table.element=f},HtmlTableImport.prototype._extractOptions=function(t,e,o){var a=t.attributes,n=o?Object.assign([],o):Object.keys(e),l={};n.forEach(function(t){l[t.toLowerCase()]=t});for(var r in a){var i,s=a[r];s&&"object"==(void 0===s?"undefined":_typeof(s))&&s.name&&0===s.name.indexOf("tabulator-")&&(i=s.name.replace("tabulator-",""),void 0!==l[i]&&(e[l[i]]=this._attribValue(s.value)))}},HtmlTableImport.prototype._attribValue=function(t){return"true"===t||"false"!==t&&t},HtmlTableImport.prototype._findCol=function(t){return this.table.options.columns.find(function(e){return e.title===t})||!1},HtmlTableImport.prototype._extractHeaders=function(t,e){for(var o=0;o<t.length;o++){var a,n=t[o],l=!1,r=this._findCol(n.textContent);r?l=!0:r={title:n.textContent.trim()},r.field||(r.field=n.textContent.trim().toLowerCase().replace(" ","_")),a=n.getAttribute("width"),a&&!r.width&&(r.width=a),n.attributes,this._extractOptions(n,r,Column.prototype.defaultOptionList),this.fieldIndex[o]=r.field,r.field==this.table.options.index&&(this.hasIndex=!0),l||this.table.options.columns.push(r)}},HtmlTableImport.prototype._generateBlankHeaders=function(t,e){for(var o=0;o<t.length;o++){var a=t[o],n={title:"",field:"col"+o};this.fieldIndex[o]=n.field;var l=a.getAttribute("width");l&&(n.width=l),this.table.options.columns.push(n)}},Tabulator.prototype.registerModule("htmlTableImport",HtmlTableImport);
@@ -0,0 +1,392 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Keybindings = function Keybindings(table) {
this.table = table; //hold Tabulator object
this.watchKeys = null;
this.pressedKeys = null;
this.keyupBinding = false;
this.keydownBinding = false;
};
Keybindings.prototype.initialize = function () {
var bindings = this.table.options.keybindings,
mergedBindings = {};
this.watchKeys = {};
this.pressedKeys = [];
if (bindings !== false) {
for (var key in this.bindings) {
mergedBindings[key] = this.bindings[key];
}
if (Object.keys(bindings).length) {
for (var _key in bindings) {
mergedBindings[_key] = bindings[_key];
}
}
this.mapBindings(mergedBindings);
this.bindEvents();
}
};
Keybindings.prototype.mapBindings = function (bindings) {
var _this = this;
var self = this;
var _loop = function _loop(key) {
if (_this.actions[key]) {
if (bindings[key]) {
if (_typeof(bindings[key]) !== "object") {
bindings[key] = [bindings[key]];
}
bindings[key].forEach(function (binding) {
self.mapBinding(key, binding);
});
}
} else {
console.warn("Key Binding Error - no such action:", key);
}
};
for (var key in bindings) {
_loop(key);
}
};
Keybindings.prototype.mapBinding = function (action, symbolsList) {
var self = this;
var binding = {
action: this.actions[action],
keys: [],
ctrl: false,
shift: false,
meta: false
};
var symbols = symbolsList.toString().toLowerCase().split(" ").join("").split("+");
symbols.forEach(function (symbol) {
switch (symbol) {
case "ctrl":
binding.ctrl = true;
break;
case "shift":
binding.shift = true;
break;
case "meta":
binding.meta = true;
break;
default:
symbol = parseInt(symbol);
binding.keys.push(symbol);
if (!self.watchKeys[symbol]) {
self.watchKeys[symbol] = [];
}
self.watchKeys[symbol].push(binding);
}
});
};
Keybindings.prototype.bindEvents = function () {
var self = this;
this.keyupBinding = function (e) {
var code = e.keyCode;
var bindings = self.watchKeys[code];
if (bindings) {
self.pressedKeys.push(code);
bindings.forEach(function (binding) {
self.checkBinding(e, binding);
});
}
};
this.keydownBinding = function (e) {
var code = e.keyCode;
var bindings = self.watchKeys[code];
if (bindings) {
var index = self.pressedKeys.indexOf(code);
if (index > -1) {
self.pressedKeys.splice(index, 1);
}
}
};
this.table.element.addEventListener("keydown", this.keyupBinding);
this.table.element.addEventListener("keyup", this.keydownBinding);
};
Keybindings.prototype.clearBindings = function () {
if (this.keyupBinding) {
this.table.element.removeEventListener("keydown", this.keyupBinding);
}
if (this.keydownBinding) {
this.table.element.removeEventListener("keyup", this.keydownBinding);
}
};
Keybindings.prototype.checkBinding = function (e, binding) {
var self = this,
match = true;
if (e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta) {
binding.keys.forEach(function (key) {
var index = self.pressedKeys.indexOf(key);
if (index == -1) {
match = false;
}
});
if (match) {
binding.action.call(self, e);
}
return true;
}
return false;
};
//default bindings
Keybindings.prototype.bindings = {
navPrev: "shift + 9",
navNext: 9,
navUp: 38,
navDown: 40,
scrollPageUp: 33,
scrollPageDown: 34,
scrollToStart: 36,
scrollToEnd: 35,
undo: "ctrl + 90",
redo: "ctrl + 89",
copyToClipboard: "ctrl + 67"
};
//default actions
Keybindings.prototype.actions = {
keyBlock: function keyBlock(e) {
e.stopPropagation();
e.preventDefault();
},
scrollPageUp: function scrollPageUp(e) {
var rowManager = this.table.rowManager,
newPos = rowManager.scrollTop - rowManager.height,
scrollMax = rowManager.element.scrollHeight;
e.preventDefault();
if (rowManager.displayRowsCount) {
if (newPos >= 0) {
rowManager.element.scrollTop = newPos;
} else {
rowManager.scrollToRow(rowManager.getDisplayRows()[0]);
}
}
this.table.element.focus();
},
scrollPageDown: function scrollPageDown(e) {
var rowManager = this.table.rowManager,
newPos = rowManager.scrollTop + rowManager.height,
scrollMax = rowManager.element.scrollHeight;
e.preventDefault();
if (rowManager.displayRowsCount) {
if (newPos <= scrollMax) {
rowManager.element.scrollTop = newPos;
} else {
rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);
}
}
this.table.element.focus();
},
scrollToStart: function scrollToStart(e) {
var rowManager = this.table.rowManager;
e.preventDefault();
if (rowManager.displayRowsCount) {
rowManager.scrollToRow(rowManager.getDisplayRows()[0]);
}
this.table.element.focus();
},
scrollToEnd: function scrollToEnd(e) {
var rowManager = this.table.rowManager;
e.preventDefault();
if (rowManager.displayRowsCount) {
rowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);
}
this.table.element.focus();
},
navPrev: function navPrev(e) {
var cell = false;
if (this.table.modExists("edit")) {
cell = this.table.modules.edit.currentCell;
if (cell) {
e.preventDefault();
cell.nav().prev();
}
}
},
navNext: function navNext(e) {
var cell = false;
var newRow = this.table.options.tabEndNewRow;
var nav;
if (this.table.modExists("edit")) {
cell = this.table.modules.edit.currentCell;
if (cell) {
e.preventDefault();
nav = cell.nav();
if (!nav.next()) {
if (newRow) {
cell.getElement().firstChild.blur();
if (newRow === true) {
newRow = this.table.addRow({});
} else {
if (typeof newRow == "function") {
newRow = this.table.addRow(newRow(cell.row.getComponent()));
} else {
newRow = this.table.addRow(newRow);
}
}
newRow.then(function () {
setTimeout(function () {
nav.next();
});
});
}
}
}
}
},
navLeft: function navLeft(e) {
var cell = false;
if (this.table.modExists("edit")) {
cell = this.table.modules.edit.currentCell;
if (cell) {
e.preventDefault();
cell.nav().left();
}
}
},
navRight: function navRight(e) {
var cell = false;
if (this.table.modExists("edit")) {
cell = this.table.modules.edit.currentCell;
if (cell) {
e.preventDefault();
cell.nav().right();
}
}
},
navUp: function navUp(e) {
var cell = false;
if (this.table.modExists("edit")) {
cell = this.table.modules.edit.currentCell;
if (cell) {
e.preventDefault();
cell.nav().up();
}
}
},
navDown: function navDown(e) {
var cell = false;
if (this.table.modExists("edit")) {
cell = this.table.modules.edit.currentCell;
if (cell) {
e.preventDefault();
cell.nav().down();
}
}
},
undo: function undo(e) {
var cell = false;
if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) {
cell = this.table.modules.edit.currentCell;
if (!cell) {
e.preventDefault();
this.table.modules.history.undo();
}
}
},
redo: function redo(e) {
var cell = false;
if (this.table.options.history && this.table.modExists("history") && this.table.modExists("edit")) {
cell = this.table.modules.edit.currentCell;
if (!cell) {
e.preventDefault();
this.table.modules.history.redo();
}
}
},
copyToClipboard: function copyToClipboard(e) {
if (!this.table.modules.edit.currentCell) {
if (this.table.modExists("clipboard", true)) {
this.table.modules.clipboard.copy(false, true);
}
}
}
};
Tabulator.prototype.registerModule("keybindings", Keybindings);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Keybindings=function(t){this.table=t,this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1};Keybindings.prototype.initialize=function(){var t=this.table.options.keybindings,e={};if(this.watchKeys={},this.pressedKeys=[],!1!==t){for(var i in this.bindings)e[i]=this.bindings[i];if(Object.keys(t).length)for(var n in t)e[n]=t[n];this.mapBindings(e),this.bindEvents()}},Keybindings.prototype.mapBindings=function(t){var e=this,i=this;for(var n in t)!function(n){e.actions[n]?t[n]&&("object"!==_typeof(t[n])&&(t[n]=[t[n]]),t[n].forEach(function(t){i.mapBinding(n,t)})):console.warn("Key Binding Error - no such action:",n)}(n)},Keybindings.prototype.mapBinding=function(t,e){var i=this,n={action:this.actions[t],keys:[],ctrl:!1,shift:!1,meta:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(function(t){switch(t){case"ctrl":n.ctrl=!0;break;case"shift":n.shift=!0;break;case"meta":n.meta=!0;break;default:t=parseInt(t),n.keys.push(t),i.watchKeys[t]||(i.watchKeys[t]=[]),i.watchKeys[t].push(n)}})},Keybindings.prototype.bindEvents=function(){var t=this;this.keyupBinding=function(e){var i=e.keyCode,n=t.watchKeys[i];n&&(t.pressedKeys.push(i),n.forEach(function(i){t.checkBinding(e,i)}))},this.keydownBinding=function(e){var i=e.keyCode;if(t.watchKeys[i]){var n=t.pressedKeys.indexOf(i);n>-1&&t.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},Keybindings.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},Keybindings.prototype.checkBinding=function(t,e){var i=this,n=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&t.metaKey==e.meta&&(e.keys.forEach(function(t){-1==i.pressedKeys.indexOf(t)&&(n=!1)}),n&&e.action.call(i,t),!0)},Keybindings.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},Keybindings.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,i=e.scrollTop-e.height;e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i>=0?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,i=e.scrollTop+e.height,n=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i<=n?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e,i=!1,n=this.table.options.tabEndNewRow;this.table.modExists("edit")&&(i=this.table.modules.edit.currentCell)&&(t.preventDefault(),e=i.nav(),e.next()||n&&(i.getElement().firstChild.blur(),n=!0===n?this.table.addRow({}):"function"==typeof n?this.table.addRow(n(i.row.getComponent())):this.table.addRow(n),n.then(function(){setTimeout(function(){e.next()})})))},navLeft:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.undo()))},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},Tabulator.prototype.registerModule("keybindings",Keybindings);
+161
View File
@@ -0,0 +1,161 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Menu = function Menu(table) {
this.table = table; //hold Tabulator object
this.menuEl = false;
this.blurEvent = this.hideMenu.bind(this);
};
Menu.prototype.initializeColumnHeader = function (column) {
var _this = this;
var headerMenuEl;
if (column.definition.headerContextMenu) {
column.getElement().addEventListener("contextmenu", function (e) {
var menu = typeof column.definition.headerContextMenu == "function" ? column.definition.headerContextMenu(column.getComponent()) : column.definition.headerContextMenu;
e.preventDefault();
_this.loadMenu(e, column, menu);
});
}
if (column.definition.headerMenu) {
headerMenuEl = document.createElement("span");
headerMenuEl.classList.add("tabulator-header-menu-button");
headerMenuEl.innerHTML = "&vellip;";
headerMenuEl.addEventListener("click", function (e) {
var menu = typeof column.definition.headerMenu == "function" ? column.definition.headerMenu(column.getComponent()) : column.definition.headerMenu;
e.stopPropagation();
e.preventDefault();
_this.loadMenu(e, column, menu);
});
column.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);
}
};
Menu.prototype.initializeCell = function (cell) {
var _this2 = this;
cell.getElement().addEventListener("contextmenu", function (e) {
var menu = typeof cell.column.definition.contextMenu == "function" ? cell.column.definition.contextMenu(cell.getComponent()) : cell.column.definition.contextMenu;
e.preventDefault();
_this2.loadMenu(e, cell, menu);
});
};
Menu.prototype.initializeRow = function (row) {
var _this3 = this;
row.getElement().addEventListener("contextmenu", function (e) {
var menu = typeof _this3.table.options.rowContextMenu == "function" ? _this3.table.options.rowContextMenu(row.getComponent()) : _this3.table.options.rowContextMenu;
e.preventDefault();
_this3.loadMenu(e, row, menu);
});
};
Menu.prototype.loadMenu = function (e, component, menu) {
var _this4 = this;
var docHeight = Math.max(document.body.offsetHeight, window.innerHeight);
//abort if no menu set
if (!menu || !menu.length) {
return;
}
this.hideMenu();
this.menuEl = document.createElement("div");
this.menuEl.classList.add("tabulator-menu");
menu.forEach(function (item) {
var itemEl = document.createElement("div");
var label = item.label;
var disabled = item.disabled;
if (item.separator) {
itemEl.classList.add("tabulator-menu-separator");
} else {
itemEl.classList.add("tabulator-menu-item");
if (typeof label == "function") {
label = label(component.getComponent());
}
if (label instanceof Node) {
itemEl.appendChild(label);
} else {
itemEl.innerHTML = label;
}
if (typeof disabled == "function") {
disabled = disabled(component.getComponent());
}
if (disabled) {
itemEl.classList.add("tabulator-menu-item-disabled");
itemEl.addEventListener("click", function (e) {
e.stopPropagation();
});
} else {
itemEl.addEventListener("click", function (e) {
_this4.hideMenu();
item.action(e, component.getComponent());
});
}
}
_this4.menuEl.appendChild(itemEl);
});
this.menuEl.style.top = e.pageY + "px";
this.menuEl.style.left = e.pageX + "px";
document.body.addEventListener("click", this.blurEvent);
this.table.rowManager.element.addEventListener("scroll", this.blurEvent);
setTimeout(function () {
document.body.addEventListener("contextmenu", _this4.blurEvent);
}, 100);
document.body.appendChild(this.menuEl);
//move menu to start on right edge if it is too close to the edge of the screen
if (e.pageX + this.menuEl.offsetWidth >= document.body.offsetWidth) {
this.menuEl.style.left = "";
this.menuEl.style.right = document.body.offsetWidth - e.pageX + "px";
}
//move menu to start on bottom edge if it is too close to the edge of the screen
if (e.pageY + this.menuEl.offsetHeight >= docHeight) {
this.menuEl.style.top = "";
this.menuEl.style.bottom = docHeight - e.pageY + "px";
}
};
Menu.prototype.hideMenu = function () {
if (this.menuEl.parentNode) {
this.menuEl.parentNode.removeChild(this.menuEl);
}
if (this.blurEvent) {
document.body.removeEventListener("click", this.blurEvent);
document.body.removeEventListener("contextmenu", this.blurEvent);
this.table.rowManager.element.removeEventListener("scroll", this.blurEvent);
}
};
//default accessors
Menu.prototype.menus = {};
Tabulator.prototype.registerModule("menu", Menu);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Menu=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this)};Menu.prototype.initializeColumnHeader=function(e){var t,n=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),n.loadMenu(t,e,i)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="&vellip;",t.addEventListener("click",function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),n.loadMenu(t,e,i)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},Menu.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;n.preventDefault(),t.loadMenu(n,e,i)})},Menu.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(n){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;n.preventDefault(),t.loadMenu(n,e,i)})},Menu.prototype.loadMenu=function(e,t,n){var i=this,o=Math.max(document.body.offsetHeight,window.innerHeight);n&&n.length&&(this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),n.forEach(function(e){var n=document.createElement("div"),o=e.label,u=e.disabled;e.separator?n.classList.add("tabulator-menu-separator"):(n.classList.add("tabulator-menu-item"),"function"==typeof o&&(o=o(t.getComponent())),o instanceof Node?n.appendChild(o):n.innerHTML=o,"function"==typeof u&&(u=u(t.getComponent())),u?(n.classList.add("tabulator-menu-item-disabled"),n.addEventListener("click",function(e){e.stopPropagation()})):n.addEventListener("click",function(n){i.hideMenu(),e.action(n,t.getComponent())})),i.menuEl.appendChild(n)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",i.blurEvent)},100),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=o&&(this.menuEl.style.top="",this.menuEl.style.bottom=o-e.pageY+"px"))},Menu.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},Menu.prototype.menus={},Tabulator.prototype.registerModule("menu",Menu);
@@ -0,0 +1,289 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var MoveColumns = function MoveColumns(table) {
this.table = table; //hold Tabulator object
this.placeholderElement = this.createPlaceholderElement();
this.hoverElement = false; //floating column header element
this.checkTimeout = false; //click check timeout holder
this.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click
this.moving = false; //currently moving column
this.toCol = false; //destination column
this.toColAfter = false; //position of moving column relative to the desitnation column
this.startX = 0; //starting position within header element
this.autoScrollMargin = 40; //auto scroll on edge when within margin
this.autoScrollStep = 5; //auto scroll distance in pixels
this.autoScrollTimeout = false; //auto scroll timeout
this.touchMove = false;
this.moveHover = this.moveHover.bind(this);
this.endMove = this.endMove.bind(this);
};
MoveColumns.prototype.createPlaceholderElement = function () {
var el = document.createElement("div");
el.classList.add("tabulator-col");
el.classList.add("tabulator-col-placeholder");
return el;
};
MoveColumns.prototype.initializeColumn = function (column) {
var self = this,
config = {},
colEl;
if (!column.modules.frozen) {
colEl = column.getElement();
config.mousemove = function (e) {
if (column.parent === self.moving.parent) {
if ((self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(colEl).left + self.table.columnManager.element.scrollLeft > column.getWidth() / 2) {
if (self.toCol !== column || !self.toColAfter) {
colEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);
self.moveColumn(column, true);
}
} else {
if (self.toCol !== column || self.toColAfter) {
colEl.parentNode.insertBefore(self.placeholderElement, colEl);
self.moveColumn(column, false);
}
}
}
}.bind(self);
colEl.addEventListener("mousedown", function (e) {
self.touchMove = false;
if (e.which === 1) {
self.checkTimeout = setTimeout(function () {
self.startMove(e, column);
}, self.checkPeriod);
}
});
colEl.addEventListener("mouseup", function (e) {
if (e.which === 1) {
if (self.checkTimeout) {
clearTimeout(self.checkTimeout);
}
}
});
self.bindTouchEvents(column);
}
column.modules.moveColumn = config;
};
MoveColumns.prototype.bindTouchEvents = function (column) {
var self = this,
colEl = column.getElement(),
startXMove = false,
//shifting center position of the cell
dir = false,
currentCol,
nextCol,
prevCol,
nextColWidth,
prevColWidth,
nextColWidthLast,
prevColWidthLast;
colEl.addEventListener("touchstart", function (e) {
self.checkTimeout = setTimeout(function () {
self.touchMove = true;
currentCol = column;
nextCol = column.nextColumn();
nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;
prevCol = column.prevColumn();
prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;
nextColWidthLast = 0;
prevColWidthLast = 0;
startXMove = false;
self.startMove(e, column);
}, self.checkPeriod);
}, { passive: true });
colEl.addEventListener("touchmove", function (e) {
var halfCol, diff, moveToCol;
if (self.moving) {
self.moveHover(e);
if (!startXMove) {
startXMove = e.touches[0].pageX;
}
diff = e.touches[0].pageX - startXMove;
if (diff > 0) {
if (nextCol && diff - nextColWidthLast > nextColWidth) {
moveToCol = nextCol;
if (moveToCol !== column) {
startXMove = e.touches[0].pageX;
moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement().nextSibling);
self.moveColumn(moveToCol, true);
}
}
} else {
if (prevCol && -diff - prevColWidthLast > prevColWidth) {
moveToCol = prevCol;
if (moveToCol !== column) {
startXMove = e.touches[0].pageX;
moveToCol.getElement().parentNode.insertBefore(self.placeholderElement, moveToCol.getElement());
self.moveColumn(moveToCol, false);
}
}
}
if (moveToCol) {
currentCol = moveToCol;
nextCol = moveToCol.nextColumn();
nextColWidthLast = nextColWidth;
nextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;
prevCol = moveToCol.prevColumn();
prevColWidthLast = prevColWidth;
prevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;
}
}
}, { passive: true });
colEl.addEventListener("touchend", function (e) {
if (self.checkTimeout) {
clearTimeout(self.checkTimeout);
}
if (self.moving) {
self.endMove(e);
}
});
};
MoveColumns.prototype.startMove = function (e, column) {
var element = column.getElement();
this.moving = column;
this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(element).left;
this.table.element.classList.add("tabulator-block-select");
//create placeholder
this.placeholderElement.style.width = column.getWidth() + "px";
this.placeholderElement.style.height = column.getHeight() + "px";
element.parentNode.insertBefore(this.placeholderElement, element);
element.parentNode.removeChild(element);
//create hover element
this.hoverElement = element.cloneNode(true);
this.hoverElement.classList.add("tabulator-moving");
this.table.columnManager.getElement().appendChild(this.hoverElement);
this.hoverElement.style.left = "0";
this.hoverElement.style.bottom = "0";
if (!this.touchMove) {
this._bindMouseMove();
document.body.addEventListener("mousemove", this.moveHover);
document.body.addEventListener("mouseup", this.endMove);
}
this.moveHover(e);
};
MoveColumns.prototype._bindMouseMove = function () {
this.table.columnManager.columnsByIndex.forEach(function (column) {
if (column.modules.moveColumn.mousemove) {
column.getElement().addEventListener("mousemove", column.modules.moveColumn.mousemove);
}
});
};
MoveColumns.prototype._unbindMouseMove = function () {
this.table.columnManager.columnsByIndex.forEach(function (column) {
if (column.modules.moveColumn.mousemove) {
column.getElement().removeEventListener("mousemove", column.modules.moveColumn.mousemove);
}
});
};
MoveColumns.prototype.moveColumn = function (column, after) {
var movingCells = this.moving.getCells();
this.toCol = column;
this.toColAfter = after;
if (after) {
column.getCells().forEach(function (cell, i) {
var cellEl = cell.getElement();
cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
});
} else {
column.getCells().forEach(function (cell, i) {
var cellEl = cell.getElement();
cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
});
}
};
MoveColumns.prototype.endMove = function (e) {
if (e.which === 1 || 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");
if (this.toCol) {
this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);
}
this.moving = false;
this.toCol = false;
this.toColAfter = false;
if (!this.touchMove) {
document.body.removeEventListener("mousemove", this.moveHover);
document.body.removeEventListener("mouseup", this.endMove);
}
}
};
MoveColumns.prototype.moveHover = function (e) {
var self = this,
columnHolder = self.table.columnManager.getElement(),
scrollLeft = columnHolder.scrollLeft,
xPos = (self.touchMove ? e.touches[0].pageX : e.pageX) - Tabulator.prototype.helpers.elOffset(columnHolder).left + scrollLeft,
scrollPos;
self.hoverElement.style.left = xPos - self.startX + "px";
if (xPos - scrollLeft < self.autoScrollMargin) {
if (!self.autoScrollTimeout) {
self.autoScrollTimeout = setTimeout(function () {
scrollPos = Math.max(0, scrollLeft - 5);
self.table.rowManager.getElement().scrollLeft = scrollPos;
self.autoScrollTimeout = false;
}, 1);
}
}
if (scrollLeft + columnHolder.clientWidth - xPos < self.autoScrollMargin) {
if (!self.autoScrollTimeout) {
self.autoScrollTimeout = setTimeout(function () {
scrollPos = Math.min(columnHolder.clientWidth, scrollLeft + 5);
self.table.rowManager.getElement().scrollLeft = scrollPos;
self.autoScrollTimeout = false;
}, 1);
}
}
};
Tabulator.prototype.registerModule("moveColumn", MoveColumns);
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var MoveColumns=function(e){this.table=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)};MoveColumns.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},MoveColumns.prototype.initializeColumn=function(e){var t,o=this,n={};e.modules.frozen||(t=e.getElement(),n.mousemove=function(n){e.parent===o.moving.parent&&((o.touchMove?n.touches[0].pageX:n.pageX)-Tabulator.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",function(t){o.touchMove=!1,1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(e)),e.modules.moveColumn=n},MoveColumns.prototype.bindTouchEvents=function(e){var t,o,n,l,i,s,m,r=this,u=e.getElement(),h=!1;u.addEventListener("touchstart",function(u){r.checkTimeout=setTimeout(function(){r.touchMove=!0,t=e,o=e.nextColumn(),l=o?o.getWidth()/2:0,n=e.prevColumn(),i=n?n.getWidth()/2:0,s=0,m=0,h=!1,r.startMove(u,e)},r.checkPeriod)},{passive:!0}),u.addEventListener("touchmove",function(u){var a,c;r.moving&&(r.moveHover(u),h||(h=u.touches[0].pageX),a=u.touches[0].pageX-h,a>0?o&&a-s>l&&(c=o)!==e&&(h=u.touches[0].pageX,c.getElement().parentNode.insertBefore(r.placeholderElement,c.getElement().nextSibling),r.moveColumn(c,!0)):n&&-a-m>i&&(c=n)!==e&&(h=u.touches[0].pageX,c.getElement().parentNode.insertBefore(r.placeholderElement,c.getElement()),r.moveColumn(c,!1)),c&&(t=c,o=c.nextColumn(),s=l,l=o?o.getWidth()/2:0,n=c.prevColumn(),m=i,i=n?n.getWidth()/2:0))},{passive:!0}),u.addEventListener("touchend",function(e){r.checkTimeout&&clearTimeout(r.checkTimeout),r.moving&&r.endMove(e)})},MoveColumns.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-Tabulator.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)},MoveColumns.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})},MoveColumns.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})},MoveColumns.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var n=e.getElement();n.parentNode.insertBefore(o[t].getElement(),n.nextSibling)}):e.getCells().forEach(function(e,t){var n=e.getElement();n.parentNode.insertBefore(o[t].getElement(),n)})},MoveColumns.prototype.endMove=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)))},MoveColumns.prototype.moveHover=function(e){var t,o=this,n=o.table.columnManager.getElement(),l=n.scrollLeft,i=(o.touchMove?e.touches[0].pageX:e.pageX)-Tabulator.prototype.helpers.elOffset(n).left+l;o.hoverElement.style.left=i-o.startX+"px",i-l<o.autoScrollMargin&&(o.autoScrollTimeout||(o.autoScrollTimeout=setTimeout(function(){t=Math.max(0,l-5),oLine truncated
@@ -0,0 +1,580 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var MoveRows = function MoveRows(table) {
this.table = table; //hold Tabulator object
this.placeholderElement = this.createPlaceholderElement();
this.hoverElement = false; //floating row header element
this.checkTimeout = false; //click check timeout holder
this.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click
this.moving = false; //currently moving row
this.toRow = false; //destination row
this.toRowAfter = false; //position of moving row relative to the desitnation row
this.hasHandle = false; //row has handle instead of fully movable row
this.startY = 0; //starting Y position within header element
this.startX = 0; //starting X position within header element
this.moveHover = this.moveHover.bind(this);
this.endMove = this.endMove.bind(this);
this.tableRowDropEvent = false;
this.touchMove = false;
this.connection = false;
this.connections = [];
this.connectedTable = false;
this.connectedRow = false;
};
MoveRows.prototype.createPlaceholderElement = function () {
var el = document.createElement("div");
el.classList.add("tabulator-row");
el.classList.add("tabulator-row-placeholder");
return el;
};
MoveRows.prototype.initialize = function (handle) {
this.connection = this.table.options.movableRowsConnectedTables;
};
MoveRows.prototype.setHandle = function (handle) {
this.hasHandle = handle;
};
MoveRows.prototype.initializeGroupHeader = function (group) {
var self = this,
config = {},
rowEl;
//inter table drag drop
config.mouseup = function (e) {
self.tableRowDrop(e, row);
}.bind(self);
//same table drag drop
config.mousemove = function (e) {
if (e.pageY - Tabulator.prototype.helpers.elOffset(group.element).top + self.table.rowManager.element.scrollTop > group.getHeight() / 2) {
if (self.toRow !== group || !self.toRowAfter) {
var rowEl = group.getElement();
rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);
self.moveRow(group, true);
}
} else {
if (self.toRow !== group || self.toRowAfter) {
var rowEl = group.getElement();
if (rowEl.previousSibling) {
rowEl.parentNode.insertBefore(self.placeholderElement, rowEl);
self.moveRow(group, false);
}
}
}
}.bind(self);
group.modules.moveRow = config;
};
MoveRows.prototype.initializeRow = function (row) {
var self = this,
config = {},
rowEl;
//inter table drag drop
config.mouseup = function (e) {
self.tableRowDrop(e, row);
}.bind(self);
//same table drag drop
config.mousemove = function (e) {
if (e.pageY - Tabulator.prototype.helpers.elOffset(row.element).top + self.table.rowManager.element.scrollTop > row.getHeight() / 2) {
if (self.toRow !== row || !self.toRowAfter) {
var rowEl = row.getElement();
rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);
self.moveRow(row, true);
}
} else {
if (self.toRow !== row || self.toRowAfter) {
var rowEl = row.getElement();
rowEl.parentNode.insertBefore(self.placeholderElement, rowEl);
self.moveRow(row, false);
}
}
}.bind(self);
if (!this.hasHandle) {
rowEl = row.getElement();
rowEl.addEventListener("mousedown", function (e) {
if (e.which === 1) {
self.checkTimeout = setTimeout(function () {
self.startMove(e, row);
}, self.checkPeriod);
}
});
rowEl.addEventListener("mouseup", function (e) {
if (e.which === 1) {
if (self.checkTimeout) {
clearTimeout(self.checkTimeout);
}
}
});
this.bindTouchEvents(row, row.getElement());
}
row.modules.moveRow = config;
};
MoveRows.prototype.initializeCell = function (cell) {
var self = this,
cellEl = cell.getElement();
cellEl.addEventListener("mousedown", function (e) {
if (e.which === 1) {
self.checkTimeout = setTimeout(function () {
self.startMove(e, cell.row);
}, self.checkPeriod);
}
});
cellEl.addEventListener("mouseup", function (e) {
if (e.which === 1) {
if (self.checkTimeout) {
clearTimeout(self.checkTimeout);
}
}
});
this.bindTouchEvents(cell.row, cell.getElement());
};
MoveRows.prototype.bindTouchEvents = function (row, element) {
var self = this,
startYMove = false,
//shifting center position of the cell
dir = false,
currentRow,
nextRow,
prevRow,
nextRowHeight,
prevRowHeight,
nextRowHeightLast,
prevRowHeightLast;
element.addEventListener("touchstart", function (e) {
self.checkTimeout = setTimeout(function () {
self.touchMove = true;
currentRow = row;
nextRow = row.nextRow();
nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;
prevRow = row.prevRow();
prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;
nextRowHeightLast = 0;
prevRowHeightLast = 0;
startYMove = false;
self.startMove(e, row);
}, self.checkPeriod);
}, { passive: true });
this.moving, this.toRow, this.toRowAfter;
element.addEventListener("touchmove", function (e) {
var halfCol, diff, moveToRow;
if (self.moving) {
e.preventDefault();
self.moveHover(e);
if (!startYMove) {
startYMove = e.touches[0].pageY;
}
diff = e.touches[0].pageY - startYMove;
if (diff > 0) {
if (nextRow && diff - nextRowHeightLast > nextRowHeight) {
moveToRow = nextRow;
if (moveToRow !== row) {
startYMove = e.touches[0].pageY;
moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement().nextSibling);
self.moveRow(moveToRow, true);
}
}
} else {
if (prevRow && -diff - prevRowHeightLast > prevRowHeight) {
moveToRow = prevRow;
if (moveToRow !== row) {
startYMove = e.touches[0].pageY;
moveToRow.getElement().parentNode.insertBefore(self.placeholderElement, moveToRow.getElement());
self.moveRow(moveToRow, false);
}
}
}
if (moveToRow) {
currentRow = moveToRow;
nextRow = moveToRow.nextRow();
nextRowHeightLast = nextRowHeight;
nextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;
prevRow = moveToRow.prevRow();
prevRowHeightLast = prevRowHeight;
prevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;
}
}
});
element.addEventListener("touchend", function (e) {
if (self.checkTimeout) {
clearTimeout(self.checkTimeout);
}
if (self.moving) {
self.endMove(e);
self.touchMove = false;
}
});
};
MoveRows.prototype._bindMouseMove = function () {
var self = this;
self.table.rowManager.getDisplayRows().forEach(function (row) {
if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) {
row.getElement().addEventListener("mousemove", row.modules.moveRow.mousemove);
}
});
};
MoveRows.prototype._unbindMouseMove = function () {
var self = this;
self.table.rowManager.getDisplayRows().forEach(function (row) {
if ((row.type === "row" || row.type === "group") && row.modules.moveRow.mousemove) {
row.getElement().removeEventListener("mousemove", row.modules.moveRow.mousemove);
}
});
};
MoveRows.prototype.startMove = function (e, row) {
var element = row.getElement();
this.setStartPosition(e, row);
this.moving = row;
this.table.element.classList.add("tabulator-block-select");
//create placeholder
this.placeholderElement.style.width = row.getWidth() + "px";
this.placeholderElement.style.height = row.getHeight() + "px";
if (!this.connection) {
element.parentNode.insertBefore(this.placeholderElement, element);
element.parentNode.removeChild(element);
} else {
this.table.element.classList.add("tabulator-movingrow-sending");
this.connectToTables(row);
}
//create hover element
this.hoverElement = element.cloneNode(true);
this.hoverElement.classList.add("tabulator-moving");
if (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";
} else {
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.moveHover(e);
};
MoveRows.prototype.setStartPosition = function (e, row) {
var pageX = this.touchMove ? e.touches[0].pageX : e.pageX,
pageY = this.touchMove ? e.touches[0].pageY : e.pageY,
element,
position;
element = row.getElement();
if (this.connection) {
position = element.getBoundingClientRect();
this.startX = position.left - pageX + window.pageXOffset;
this.startY = position.top - pageY + window.pageYOffset;
} else {
this.startY = pageY - element.getBoundingClientRect().top;
}
};
MoveRows.prototype.endMove = function (e) {
if (!e || e.which === 1 || this.touchMove) {
this._unbindMouseMove();
if (!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");
if (this.toRow) {
this.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);
}
this.moving = false;
this.toRow = false;
this.toRowAfter = false;
document.body.removeEventListener("mousemove", this.moveHover);
document.body.removeEventListener("mouseup", this.endMove);
if (this.connection) {
this.table.element.classList.remove("tabulator-movingrow-sending");
this.disconnectFromTables();
}
}
};
MoveRows.prototype.moveRow = function (row, after) {
this.toRow = row;
this.toRowAfter = after;
};
MoveRows.prototype.moveHover = function (e) {
if (this.connection) {
this.moveHoverConnections.call(this, e);
} else {
this.moveHoverTable.call(this, e);
}
};
MoveRows.prototype.moveHoverTable = function (e) {
var rowHolder = this.table.rowManager.getElement(),
scrollTop = rowHolder.scrollTop,
yPos = (this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top + scrollTop,
scrollPos;
this.hoverElement.style.top = yPos - this.startY + "px";
};
MoveRows.prototype.moveHoverConnections = 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";
};
//establish connection with other tables
MoveRows.prototype.connectToTables = function (row) {
var self = this,
connections = this.table.modules.comms.getConnections(this.connection);
this.table.options.movableRowsSendingStart.call(this.table, connections);
this.table.modules.comms.send(this.connection, "moveRow", "connect", {
row: row
});
};
//disconnect from other tables
MoveRows.prototype.disconnectFromTables = function () {
var self = this,
connections = this.table.modules.comms.getConnections(this.connection);
this.table.options.movableRowsSendingStop.call(this.table, connections);
this.table.modules.comms.send(this.connection, "moveRow", "disconnect");
};
//accept incomming connection
MoveRows.prototype.connect = function (table, row) {
var self = this;
if (!this.connectedTable) {
this.connectedTable = table;
this.connectedRow = row;
this.table.element.classList.add("tabulator-movingrow-receiving");
self.table.rowManager.getDisplayRows().forEach(function (row) {
if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) {
row.getElement().addEventListener("mouseup", row.modules.moveRow.mouseup);
}
});
self.tableRowDropEvent = self.tableRowDrop.bind(self);
self.table.element.addEventListener("mouseup", self.tableRowDropEvent);
this.table.options.movableRowsReceivingStart.call(this.table, row, table);
return true;
} else {
console.warn("Move Row Error - Table cannot accept connection, already connected to table:", this.connectedTable);
return false;
}
};
//close incomming connection
MoveRows.prototype.disconnect = function (table) {
var self = this;
if (table === this.connectedTable) {
this.connectedTable = false;
this.connectedRow = false;
this.table.element.classList.remove("tabulator-movingrow-receiving");
self.table.rowManager.getDisplayRows().forEach(function (row) {
if (row.type === "row" && row.modules.moveRow && row.modules.moveRow.mouseup) {
row.getElement().removeEventListener("mouseup", row.modules.moveRow.mouseup);
}
});
self.table.element.removeEventListener("mouseup", self.tableRowDropEvent);
this.table.options.movableRowsReceivingStop.call(this.table, table);
} else {
console.warn("Move Row Error - trying to disconnect from non connected table");
}
};
MoveRows.prototype.dropComplete = function (table, row, success) {
var sender = false;
if (success) {
switch (_typeof(this.table.options.movableRowsSender)) {
case "string":
sender = this.senders[this.table.options.movableRowsSender];
break;
case "function":
sender = this.table.options.movableRowsSender;
break;
}
if (sender) {
sender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table);
} else {
if (this.table.options.movableRowsSender) {
console.warn("Mover Row Error - no matching sender found:", this.table.options.movableRowsSender);
}
}
this.table.options.movableRowsSent.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table);
} else {
this.table.options.movableRowsSentFailed.call(this.table, this.moving.getComponent(), row ? row.getComponent() : undefined, table);
}
this.endMove();
};
MoveRows.prototype.tableRowDrop = function (e, row) {
var receiver = false,
success = false;
e.stopImmediatePropagation();
switch (_typeof(this.table.options.movableRowsReceiver)) {
case "string":
receiver = this.receivers[this.table.options.movableRowsReceiver];
break;
case "function":
receiver = this.table.options.movableRowsReceiver;
break;
}
if (receiver) {
success = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);
} else {
console.warn("Mover Row Error - no matching receiver found:", this.table.options.movableRowsReceiver);
}
if (success) {
this.table.options.movableRowsReceived.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);
} else {
this.table.options.movableRowsReceivedFailed.call(this.table, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);
}
this.table.modules.comms.send(this.connectedTable, "moveRow", "dropcomplete", {
row: row,
success: success
});
};
MoveRows.prototype.receivers = {
insert: function insert(fromRow, toRow, fromTable) {
this.table.addRow(fromRow.getData(), undefined, toRow);
return true;
},
add: function add(fromRow, toRow, fromTable) {
this.table.addRow(fromRow.getData());
return true;
},
update: function update(fromRow, toRow, fromTable) {
if (toRow) {
toRow.update(fromRow.getData());
return true;
}
return false;
},
replace: function replace(fromRow, toRow, fromTable) {
if (toRow) {
this.table.addRow(fromRow.getData(), undefined, toRow);
toRow.delete();
return true;
}
return false;
}
};
MoveRows.prototype.senders = {
delete: function _delete(fromRow, toRow, toTable) {
fromRow.delete();
}
};
MoveRows.prototype.commsReceived = function (table, action, data) {
switch (action) {
case "connect":
return this.connect(table, data.row);
break;
case "disconnect":
return this.disconnect(table);
break;
case "dropcomplete":
return this.dropComplete(table, data.row, data.success);
break;
}
};
Tabulator.prototype.registerModule("moveRow", MoveRows);
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="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},MoveRows=function(e){this.table=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.connections=[],this.connectedTable=!1,this.connectedRow=!1};MoveRows.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e},MoveRows.prototype.initialize=function(e){this.connection=this.table.options.movableRowsConnectedTables},MoveRows.prototype.setHandle=function(e){this.hasHandle=e},MoveRows.prototype.initializeGroupHeader=function(e){var t=this,o={};o.mouseup=function(e){t.tableRowDrop(e,row)}.bind(t),o.mousemove=function(o){if(o.pageY-Tabulator.prototype.helpers.elOffset(e.element).top+t.table.rowManager.element.scrollTop>e.getHeight()/2){if(t.toRow!==e||!t.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)}}else if(t.toRow!==e||t.toRowAfter){var n=e.getElement();n.previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1))}}.bind(t),e.modules.moveRow=o},MoveRows.prototype.initializeRow=function(e){var t,o=this,n={};n.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),n.mousemove=function(t){if(t.pageY-Tabulator.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(o.placeholderElement,n.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(o.placeholderElement,n),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=n},MoveRows.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(t.checkTimeout=setTimeout(function(){t.startMove(o,e.row)},t.checkPeriod))}),o.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,e.getElement())},MoveRows.prototype.bindTouchEvents=function(e,t){var o,n,i,s,l,r,a,c=this,h=!1;t.addEventListener("touchstart",function(t){c.checkTimeout=setTimeout(function(){c.touchMove=!0,o=e,n=e.nextRow(),s=n?n.getHeight()/2:0,i=e.prevRow(),l=i?i.getHeight()/2:0,r=0,a=0,h=!1,c.startMove(t,e)},c.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",function(t){var m,v;c.moving&&(t.preventDefault(),c.moveHover(t),h||(h=t.touches[0].pageY),m=t.touches[0].pageY-h,m>0?n&&m-r>s&&(v=n)!==e&&(h=t.touches[0].pageY,v.getElement().parentNode.insertBefore(c.placeholderElement,v.getElement().nextSibling),c.moveRow(v,!0)):i&&-m-a>l&&(v=i)!==e&&(h=t.touches[0].pageY,v.getElement().parentNode.insertBefore(c.placeholderElement,v.getElement()),c.moveRow(v,!1)),v&&(o=v,n=v.nextRow(),r=s,s=n?n.getHeight()/2:0,i=v.prevRow(),a=l,l=i?i.getHeight()/2:0))}),t.addEventListener("touchend",function(e){c.checkTimeout&&clearTimeout(c.checkTimeout),c.moving&&(c.endMove(e),c.touchMove=!1)})},MoveRows.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})},MoveRows.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"!==e.type&&"group"!==e.type||!e.modules.moveRow.mousemove||e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})},MoveRows.prototype.startMove=function(e,t){var o=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)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.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.elementLine truncated
@@ -0,0 +1,116 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Mutator = function Mutator(table) {
this.table = table; //hold Tabulator object
this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of muatation types
this.enabled = true;
};
//initialize column mutator
Mutator.prototype.initializeColumn = function (column) {
var self = this,
match = false,
config = {};
this.allowedTypes.forEach(function (type) {
var key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)),
mutator;
if (column.definition[key]) {
mutator = self.lookupMutator(column.definition[key]);
if (mutator) {
match = true;
config[key] = {
mutator: mutator,
params: column.definition[key + "Params"] || {}
};
}
}
});
if (match) {
column.modules.mutate = config;
}
};
Mutator.prototype.lookupMutator = function (value) {
var mutator = false;
//set column mutator
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) {
case "string":
if (this.mutators[value]) {
mutator = this.mutators[value];
} else {
console.warn("Mutator Error - No such mutator found, ignoring: ", value);
}
break;
case "function":
mutator = value;
break;
}
return mutator;
};
//apply mutator to row
Mutator.prototype.transformRow = function (data, type, updatedData) {
var self = this,
key = "mutator" + (type.charAt(0).toUpperCase() + type.slice(1)),
value;
if (this.enabled) {
self.table.columnManager.traverse(function (column) {
var mutator, params, component;
if (column.modules.mutate) {
mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;
if (mutator) {
value = column.getFieldValue(typeof updatedData !== "undefined" ? updatedData : data);
if (type == "data" || typeof value !== "undefined") {
component = column.getComponent();
params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params;
column.setFieldValue(data, mutator.mutator(value, data, type, params, component));
}
}
}
});
}
return data;
};
//apply mutator to new cell value
Mutator.prototype.transformCell = function (cell, value) {
var mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,
tempData = {};
if (mutator) {
tempData = Object.assign(tempData, cell.row.getData());
cell.column.setFieldValue(tempData, value);
return mutator.mutator(value, tempData, "edit", mutator.params, cell.getComponent());
} else {
return value;
}
};
Mutator.prototype.enable = function () {
this.enabled = true;
};
Mutator.prototype.disable = function () {
this.enabled = false;
};
//default mutators
Mutator.prototype.mutators = {};
Tabulator.prototype.registerModule("mutator", Mutator);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mutator=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};Mutator.prototype.initializeColumn=function(t){var o=this,e=!1,a={};this.allowedTypes.forEach(function(r){var u,n="mutator"+(r.charAt(0).toUpperCase()+r.slice(1));t.definition[n]&&(u=o.lookupMutator(t.definition[n]))&&(e=!0,a[n]={mutator:u,params:t.definition[n+"Params"]||{}})}),e&&(t.modules.mutate=a)},Mutator.prototype.lookupMutator=function(t){var o=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.mutators[t]?o=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":o=t}return o},Mutator.prototype.transformRow=function(t,o,e){var a,r=this,u="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));return this.enabled&&r.table.columnManager.traverse(function(r){var n,i,s;r.modules.mutate&&(n=r.modules.mutate[u]||r.modules.mutate.mutator||!1)&&(a=r.getFieldValue(void 0!==e?e:t),"data"!=o&&void 0===a||(s=r.getComponent(),i="function"==typeof n.params?n.params(a,t,o,s):n.params,r.setFieldValue(t,n.mutator(a,t,o,i,s))))}),t},Mutator.prototype.transformCell=function(t,o){var e=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,a={};return e?(a=Object.assign(a,t.row.getData()),t.column.setFieldValue(a,o),e.mutator(o,a,"edit",e.params,t.getComponent())):o},Mutator.prototype.enable=function(){this.enabled=!0},Mutator.prototype.disable=function(){this.enabled=!1},Mutator.prototype.mutators={},Tabulator.prototype.registerModule("mutator",Mutator);
+693
View File
@@ -0,0 +1,693 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Page = function Page(table) {
this.table = table; //hold Tabulator object
this.mode = "local";
this.progressiveLoad = false;
this.size = 0;
this.page = 1;
this.count = 5;
this.max = 1;
this.displayIndex = 0; //index in display pipeline
this.initialLoad = true;
this.pageSizes = [];
this.dataReceivedNames = {};
this.dataSentNames = {};
this.createElements();
};
Page.prototype.createElements = function () {
var button;
this.element = document.createElement("span");
this.element.classList.add("tabulator-paginator");
this.pagesElement = document.createElement("span");
this.pagesElement.classList.add("tabulator-pages");
button = document.createElement("button");
button.classList.add("tabulator-page");
button.setAttribute("type", "button");
button.setAttribute("role", "button");
button.setAttribute("aria-label", "");
button.setAttribute("title", "");
this.firstBut = button.cloneNode(true);
this.firstBut.setAttribute("data-page", "first");
this.prevBut = button.cloneNode(true);
this.prevBut.setAttribute("data-page", "prev");
this.nextBut = button.cloneNode(true);
this.nextBut.setAttribute("data-page", "next");
this.lastBut = button.cloneNode(true);
this.lastBut.setAttribute("data-page", "last");
if (this.table.options.paginationSizeSelector) {
this.pageSizeSelect = document.createElement("select");
this.pageSizeSelect.classList.add("tabulator-page-size");
}
};
Page.prototype.generatePageSizeSelectList = function () {
var _this = this;
var pageSizes = [];
if (this.pageSizeSelect) {
if (Array.isArray(this.table.options.paginationSizeSelector)) {
pageSizes = this.table.options.paginationSizeSelector;
this.pageSizes = pageSizes;
if (this.pageSizes.indexOf(this.size) == -1) {
pageSizes.unshift(this.size);
}
} else {
if (this.pageSizes.indexOf(this.size) == -1) {
pageSizes = [];
for (var i = 1; i < 5; i++) {
pageSizes.push(this.size * i);
}
this.pageSizes = pageSizes;
} else {
pageSizes = this.pageSizes;
}
}
while (this.pageSizeSelect.firstChild) {
this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);
}pageSizes.forEach(function (item) {
var itemEl = document.createElement("option");
itemEl.value = item;
itemEl.innerHTML = item;
_this.pageSizeSelect.appendChild(itemEl);
});
this.pageSizeSelect.value = this.size;
}
};
//setup pageination
Page.prototype.initialize = function (hidden) {
var self = this,
pageSelectLabel,
testElRow,
testElCell;
//update param names
this.dataSentNames = Object.assign({}, this.paginationDataSentNames);
this.dataSentNames = Object.assign(this.dataSentNames, this.table.options.paginationDataSent);
this.dataReceivedNames = Object.assign({}, this.paginationDataReceivedNames);
this.dataReceivedNames = Object.assign(this.dataReceivedNames, this.table.options.paginationDataReceived);
//build pagination element
//bind localizations
self.table.modules.localize.bind("pagination|first", function (value) {
self.firstBut.innerHTML = value;
});
self.table.modules.localize.bind("pagination|first_title", function (value) {
self.firstBut.setAttribute("aria-label", value);
self.firstBut.setAttribute("title", value);
});
self.table.modules.localize.bind("pagination|prev", function (value) {
self.prevBut.innerHTML = value;
});
self.table.modules.localize.bind("pagination|prev_title", function (value) {
self.prevBut.setAttribute("aria-label", value);
self.prevBut.setAttribute("title", value);
});
self.table.modules.localize.bind("pagination|next", function (value) {
self.nextBut.innerHTML = value;
});
self.table.modules.localize.bind("pagination|next_title", function (value) {
self.nextBut.setAttribute("aria-label", value);
self.nextBut.setAttribute("title", value);
});
self.table.modules.localize.bind("pagination|last", function (value) {
self.lastBut.innerHTML = value;
});
self.table.modules.localize.bind("pagination|last_title", function (value) {
self.lastBut.setAttribute("aria-label", value);
self.lastBut.setAttribute("title", value);
});
//click bindings
self.firstBut.addEventListener("click", function () {
self.setPage(1);
});
self.prevBut.addEventListener("click", function () {
self.previousPage();
});
self.nextBut.addEventListener("click", function () {
self.nextPage().then(function () {}).catch(function () {});
});
self.lastBut.addEventListener("click", function () {
self.setPage(self.max);
});
if (self.table.options.paginationElement) {
self.element = self.table.options.paginationElement;
}
if (this.pageSizeSelect) {
pageSelectLabel = document.createElement("label");
self.table.modules.localize.bind("pagination|page_size", function (value) {
self.pageSizeSelect.setAttribute("aria-label", value);
self.pageSizeSelect.setAttribute("title", value);
pageSelectLabel.innerHTML = value;
});
self.element.appendChild(pageSelectLabel);
self.element.appendChild(self.pageSizeSelect);
self.pageSizeSelect.addEventListener("change", function (e) {
self.setPageSize(self.pageSizeSelect.value);
self.setPage(1).then(function () {}).catch(function () {});
});
}
//append to DOM
self.element.appendChild(self.firstBut);
self.element.appendChild(self.prevBut);
self.element.appendChild(self.pagesElement);
self.element.appendChild(self.nextBut);
self.element.appendChild(self.lastBut);
if (!self.table.options.paginationElement && !hidden) {
self.table.footerManager.append(self.element, self);
}
//set default values
self.mode = self.table.options.pagination;
if (self.table.options.paginationSize) {
self.size = self.table.options.paginationSize;
} else {
testElRow = document.createElement("div");
testElRow.classList.add("tabulator-row");
testElRow.style.visibility = hidden;
testElCell = document.createElement("div");
testElCell.classList.add("tabulator-cell");
testElCell.innerHTML = "Page Row Test";
testElRow.appendChild(testElCell);
self.table.rowManager.getTableElement().appendChild(testElRow);
self.size = Math.floor(self.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);
self.table.rowManager.getTableElement().removeChild(testElRow);
}
// self.page = self.table.options.paginationInitialPage || 1;
self.count = self.table.options.paginationButtonCount;
self.generatePageSizeSelectList();
};
Page.prototype.initializeProgressive = function (mode) {
this.initialize(true);
this.mode = "progressive_" + mode;
this.progressiveLoad = true;
};
Page.prototype.setDisplayIndex = function (index) {
this.displayIndex = index;
};
Page.prototype.getDisplayIndex = function () {
return this.displayIndex;
};
//calculate maximum page from number of rows
Page.prototype.setMaxRows = function (rowCount) {
if (!rowCount) {
this.max = 1;
} else {
this.max = Math.ceil(rowCount / this.size);
}
if (this.page > this.max) {
this.page = this.max;
}
};
//reset to first page without triggering action
Page.prototype.reset = function (force, columnsChanged) {
if (this.mode == "local" || force) {
this.page = 1;
}
if (columnsChanged) {
this.initialLoad = true;
}
return true;
};
//set the maxmum page
Page.prototype.setMaxPage = function (max) {
max = parseInt(max);
this.max = max || 1;
if (this.page > this.max) {
this.page = this.max;
this.trigger();
}
};
//set current page number
Page.prototype.setPage = function (page) {
var _this2 = this;
var self = this;
return new Promise(function (resolve, reject) {
page = parseInt(page);
if (page > 0 && page <= _this2.max) {
_this2.page = page;
_this2.trigger().then(function () {
resolve();
}).catch(function () {
reject();
});
if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.page) {
self.table.modules.persistence.save("page");
}
} else {
console.warn("Pagination Error - Requested page is out of range of 1 - " + _this2.max + ":", page);
reject();
}
});
};
Page.prototype.setPageToRow = function (row) {
var _this3 = this;
return new Promise(function (resolve, reject) {
var rows = _this3.table.rowManager.getDisplayRows(_this3.displayIndex - 1);
var index = rows.indexOf(row);
if (index > -1) {
var page = Math.ceil((index + 1) / _this3.size);
_this3.setPage(page).then(function () {
resolve();
}).catch(function () {
reject();
});
} else {
console.warn("Pagination Error - Requested row is not visible");
reject();
}
});
};
Page.prototype.setPageSize = function (size) {
size = parseInt(size);
if (size > 0) {
this.size = size;
}
if (this.pageSizeSelect) {
// this.pageSizeSelect.value = size;
this.generatePageSizeSelectList();
}
if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.page) {
this.table.modules.persistence.save("page");
}
};
//setup the pagination buttons
Page.prototype._setPageButtons = function () {
var self = this;
var leftSize = Math.floor((this.count - 1) / 2);
var rightSize = Math.ceil((this.count - 1) / 2);
var min = this.max - this.page + leftSize + 1 < this.count ? this.max - this.count + 1 : Math.max(this.page - leftSize, 1);
var max = this.page <= rightSize ? Math.min(this.count, this.max) : Math.min(this.page + rightSize, this.max);
while (self.pagesElement.firstChild) {
self.pagesElement.removeChild(self.pagesElement.firstChild);
}if (self.page == 1) {
self.firstBut.disabled = true;
self.prevBut.disabled = true;
} else {
self.firstBut.disabled = false;
self.prevBut.disabled = false;
}
if (self.page == self.max) {
self.lastBut.disabled = true;
self.nextBut.disabled = true;
} else {
self.lastBut.disabled = false;
self.nextBut.disabled = false;
}
for (var i = min; i <= max; i++) {
if (i > 0 && i <= self.max) {
self.pagesElement.appendChild(self._generatePageButton(i));
}
}
this.footerRedraw();
};
Page.prototype._generatePageButton = function (page) {
var self = this,
button = document.createElement("button");
button.classList.add("tabulator-page");
if (page == self.page) {
button.classList.add("active");
}
button.setAttribute("type", "button");
button.setAttribute("role", "button");
button.setAttribute("aria-label", "Show Page " + page);
button.setAttribute("title", "Show Page " + page);
button.setAttribute("data-page", page);
button.textContent = page;
button.addEventListener("click", function (e) {
self.setPage(page);
});
return button;
};
//previous page
Page.prototype.previousPage = function () {
var _this4 = this;
return new Promise(function (resolve, reject) {
if (_this4.page > 1) {
_this4.page--;
_this4.trigger().then(function () {
resolve();
}).catch(function () {
reject();
});
if (_this4.table.options.persistence && _this4.table.modExists("persistence", true) && _this4.table.modules.persistence.config.page) {
_this4.table.modules.persistence.save("page");
}
} else {
console.warn("Pagination Error - Previous page would be less than page 1:", 0);
reject();
}
});
};
//next page
Page.prototype.nextPage = function () {
var _this5 = this;
return new Promise(function (resolve, reject) {
if (_this5.page < _this5.max) {
_this5.page++;
_this5.trigger().then(function () {
resolve();
}).catch(function () {
reject();
});
if (_this5.table.options.persistence && _this5.table.modExists("persistence", true) && _this5.table.modules.persistence.config.page) {
_this5.table.modules.persistence.save("page");
}
} else {
if (!_this5.progressiveLoad) {
console.warn("Pagination Error - Next page would be greater than maximum page of " + _this5.max + ":", _this5.max + 1);
}
reject();
}
});
};
//return current page number
Page.prototype.getPage = function () {
return this.page;
};
//return max page number
Page.prototype.getPageMax = function () {
return this.max;
};
Page.prototype.getPageSize = function (size) {
return this.size;
};
Page.prototype.getMode = function () {
return this.mode;
};
//return appropriate rows for current page
Page.prototype.getRows = function (data) {
var output, start, end;
if (this.mode == "local") {
output = [];
start = this.size * (this.page - 1);
end = start + parseInt(this.size);
this._setPageButtons();
for (var i = start; i < end; i++) {
if (data[i]) {
output.push(data[i]);
}
}
return output;
} else {
this._setPageButtons();
return data.slice(0);
}
};
Page.prototype.trigger = function () {
var _this6 = this;
var left;
return new Promise(function (resolve, reject) {
switch (_this6.mode) {
case "local":
left = _this6.table.rowManager.scrollLeft;
_this6.table.rowManager.refreshActiveData("page");
_this6.table.rowManager.scrollHorizontal(left);
_this6.table.options.pageLoaded.call(_this6.table, _this6.getPage());
resolve();
break;
case "remote":
case "progressive_load":
case "progressive_scroll":
_this6.table.modules.ajax.blockActiveRequest();
_this6._getRemotePage().then(function () {
resolve();
}).catch(function () {
reject();
});
break;
default:
console.warn("Pagination Error - no such pagination mode:", _this6.mode);
reject();
}
});
};
Page.prototype._getRemotePage = function () {
var _this7 = this;
var self = this,
oldParams,
pageParams;
return new Promise(function (resolve, reject) {
if (!self.table.modExists("ajax", true)) {
reject();
}
//record old params and restore after request has been made
oldParams = Tabulator.prototype.helpers.deepClone(self.table.modules.ajax.getParams() || {});
pageParams = self.table.modules.ajax.getParams();
//configure request params
pageParams[_this7.dataSentNames.page] = self.page;
//set page size if defined
if (_this7.size) {
pageParams[_this7.dataSentNames.size] = _this7.size;
}
//set sort data if defined
if (_this7.table.options.ajaxSorting && _this7.table.modExists("sort")) {
var sorters = self.table.modules.sort.getSort();
sorters.forEach(function (item) {
delete item.column;
});
pageParams[_this7.dataSentNames.sorters] = sorters;
}
//set filter data if defined
if (_this7.table.options.ajaxFiltering && _this7.table.modExists("filter")) {
var filters = self.table.modules.filter.getFilters(true, true);
pageParams[_this7.dataSentNames.filters] = filters;
}
self.table.modules.ajax.setParams(pageParams);
self.table.modules.ajax.sendRequest(_this7.progressiveLoad).then(function (data) {
self._parseRemoteData(data);
resolve();
}).catch(function (e) {
reject();
});
self.table.modules.ajax.setParams(oldParams);
});
};
Page.prototype._parseRemoteData = function (data) {
var self = this,
left,
data,
margin;
if (typeof data[this.dataReceivedNames.last_page] === "undefined") {
console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.last_page + "' property");
}
if (data[this.dataReceivedNames.data]) {
this.max = parseInt(data[this.dataReceivedNames.last_page]) || 1;
if (this.progressiveLoad) {
switch (this.mode) {
case "progressive_load":
if (this.page == 1) {
this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1);
} else {
this.table.rowManager.addRows(data[this.dataReceivedNames.data]);
}
if (this.page < this.max) {
setTimeout(function () {
self.nextPage().then(function () {}).catch(function () {});
}, self.table.options.ajaxProgressiveLoadDelay);
}
break;
case "progressive_scroll":
data = this.table.rowManager.getData().concat(data[this.dataReceivedNames.data]);
this.table.rowManager.setData(data, true, this.initialLoad && this.page == 1);
margin = this.table.options.ajaxProgressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2;
if (self.table.rowManager.element.scrollHeight <= self.table.rowManager.element.clientHeight + margin) {
self.nextPage().then(function () {}).catch(function () {});
}
break;
}
} else {
left = this.table.rowManager.scrollLeft;
this.table.rowManager.setData(data[this.dataReceivedNames.data], false, this.initialLoad && this.page == 1);
this.table.rowManager.scrollHorizontal(left);
this.table.columnManager.scrollHorizontal(left);
this.table.options.pageLoaded.call(this.table, this.getPage());
}
this.initialLoad = false;
} else {
console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.data + "' property");
}
};
//handle the footer element being redrawn
Page.prototype.footerRedraw = function () {
var footer = this.table.footerManager.element;
if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) {
this.pagesElement.style.display = 'none';
} else {
this.pagesElement.style.display = '';
if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) {
this.pagesElement.style.display = 'none';
}
}
};
//set the paramter names for pagination requests
Page.prototype.paginationDataSentNames = {
"page": "page",
"size": "size",
"sorters": "sorters",
// "sort_dir":"sort_dir",
"filters": "filters"
// "filter_value":"filter_value",
// "filter_type":"filter_type",
};
//set the property names for pagination responses
Page.prototype.paginationDataReceivedNames = {
"current_page": "current_page",
"last_page": "last_page",
"data": "data"
};
Tabulator.prototype.registerModule("page", Page);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Page=function(e){this.table=e,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.initialLoad=!0,this.pageSizes=[],this.dataReceivedNames={},this.dataSentNames={},this.createElements()};Page.prototype.createElements=function(){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"),e.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"))},Page.prototype.generatePageSizeSelectList=function(){var e=this,t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(var a=1;a<5;a++)t.push(this.size*a);this.pageSizes=t}else t=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(function(t){var a=document.createElement("option");a.value=t,a.innerHTML=t,e.pageSizeSelect.appendChild(a)}),this.pageSizeSelect.value=this.size}},Page.prototype.initialize=function(e){var t,a,i,s=this;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),s.table.modules.localize.bind("pagination|first",function(e){s.firstBut.innerHTML=e}),s.table.modules.localize.bind("pagination|first_title",function(e){s.firstBut.setAttribute("aria-label",e),s.firstBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|prev",function(e){s.prevBut.innerHTML=e}),s.table.modules.localize.bind("pagination|prev_title",function(e){s.prevBut.setAttribute("aria-label",e),s.prevBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|next",function(e){s.nextBut.innerHTML=e}),s.table.modules.localize.bind("pagination|next_title",function(e){s.nextBut.setAttribute("aria-label",e),s.nextBut.setAttribute("title",e)}),s.table.modules.localize.bind("pagination|last",function(e){s.lastBut.innerHTML=e}),s.table.modules.localize.bind("pagination|last_title",function(e){s.lastBut.setAttribute("aria-label",e),s.lastBut.setAttribute("title",e)}),s.firstBut.addEventListener("click",function(){s.setPage(1)}),s.prevBut.addEventListener("click",function(){s.previousPage()}),s.nextBut.addEventListener("click",function(){s.nextPage().then(function(){}).catch(function(){})}),s.lastBut.addEventListener("click",function(){s.setPage(s.max)}),s.table.options.paginationElement&&(s.element=s.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),s.table.modules.localize.bind("pagination|page_size",function(e){s.pageSizeSelect.setAttribute("aria-label",e),s.pageSizeSelect.setAttribute("title",e),t.innerHTML=e}),s.element.appendChild(t),s.element.appendChild(s.pageSizeSelect),s.pageSizeSelect.addEventListener("change",function(e){s.setPageSize(s.pageSizeSelect.value),s.setPage(1).then(function(){}).catch(function(){})})),s.element.appendChild(s.firstBut),s.element.appendChild(s.prevBut),s.element.appendChild(s.pagesElement),s.element.appendChild(s.nextBut),s.element.appendChild(s.lastBut),s.table.options.paginationElement||e||s.table.footerManager.append(s.element,s),s.mode=s.table.options.pagination,s.table.options.paginationSize?s.size=s.table.options.paginationSize:(a=document.createElement("div"),a.classList.add("tabulator-row"),a.style.visibility=e,i=document.createElement("div"),i.classList.add("tabulator-cell"),i.innerHTML="Page Row Test",a.appendChild(i),s.table.rowManager.getTableElement().appendChild(a),s.size=Math.floor(s.table.rowManager.getElement().clientHeight/a.offsetHeight),s.table.rowManager.getTableElement().removeChild(a)),s.count=s.table.options.paginationButtonCount,s.generatePageSizeSelectList()},Page.prototype.initializeProgressive=function(e){this.initialize(!0),this.mode="progressive_"+e,this.progressiveLoad=!0},Page.prototype.setDisplayIndex=function(e){this.displayIndex=e},Page.prototype.getDisplayIndex=function(){return this.displayIndex},Page.prototype.setMaLine truncated
@@ -0,0 +1,411 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Persistence = function Persistence(table) {
this.table = table; //hold Tabulator object
this.mode = "";
this.id = "";
// this.persistProps = ["field", "width", "visible"];
this.defWatcherBlock = false;
this.config = {};
this.readFunc = false;
this.writeFunc = false;
};
// Test for whether localStorage is available for use.
Persistence.prototype.localStorageTest = function () {
var testKey = "_tabulator_test";
try {
window.localStorage.setItem(testKey, testKey);
window.localStorage.removeItem(testKey);
return true;
} catch (e) {
return false;
}
};
//setup parameters
Persistence.prototype.initialize = function () {
//determine persistent layout storage type
var mode = this.table.options.persistenceMode,
id = this.table.options.persistenceID,
retreivedData;
this.mode = mode !== true ? mode : this.localStorageTest() ? "local" : "cookie";
if (this.table.options.persistenceReaderFunc) {
if (typeof this.table.options.persistenceReaderFunc === "function") {
this.readFunc = this.table.options.persistenceReaderFunc;
} else {
if (this.readers[this.table.options.persistenceReaderFunc]) {
this.readFunc = this.readers[this.table.options.persistenceReaderFunc];
} else {
console.warn("Persistence Read Error - invalid reader set", this.table.options.persistenceReaderFunc);
}
}
} else {
if (this.readers[this.mode]) {
this.readFunc = this.readers[this.mode];
} else {
console.warn("Persistence Read Error - invalid reader set", this.mode);
}
}
if (this.table.options.persistenceWriterFunc) {
if (typeof this.table.options.persistenceWriterFunc === "function") {
this.writeFunc = this.table.options.persistenceWriterFunc;
} else {
if (this.readers[this.table.options.persistenceWriterFunc]) {
this.writeFunc = this.readers[this.table.options.persistenceWriterFunc];
} else {
console.warn("Persistence Write Error - invalid reader set", this.table.options.persistenceWriterFunc);
}
}
} else {
if (this.writers[this.mode]) {
this.writeFunc = this.writers[this.mode];
} else {
console.warn("Persistence Write Error - invalid writer set", this.mode);
}
}
//set storage tag
this.id = "tabulator-" + (id || this.table.element.getAttribute("id") || "");
this.config = {
sort: this.table.options.persistence === true || this.table.options.persistence.sort,
filter: this.table.options.persistence === true || this.table.options.persistence.filter,
group: this.table.options.persistence === true || this.table.options.persistence.group,
page: this.table.options.persistence === true || this.table.options.persistence.page,
columns: this.table.options.persistence === true ? ["title", "width", "visible"] : this.table.options.persistence.columns
};
//load pagination data if needed
if (this.config.page) {
retreivedData = this.retreiveData("page");
if (retreivedData) {
if (typeof retreivedData.paginationSize !== "undefined" && (this.config.page === true || this.config.page.size)) {
this.table.options.paginationSize = retreivedData.paginationSize;
}
if (typeof retreivedData.paginationInitialPage !== "undefined" && (this.config.page === true || this.config.page.page)) {
this.table.options.paginationInitialPage = retreivedData.paginationInitialPage;
}
}
}
//load group data if needed
if (this.config.group) {
retreivedData = this.retreiveData("group");
if (retreivedData) {
if (typeof retreivedData.groupBy !== "undefined" && (this.config.group === true || this.config.group.groupBy)) {
this.table.options.groupBy = retreivedData.groupBy;
}
if (typeof retreivedData.groupStartOpen !== "undefined" && (this.config.group === true || this.config.group.groupStartOpen)) {
this.table.options.groupStartOpen = retreivedData.groupStartOpen;
}
if (typeof retreivedData.groupHeader !== "undefined" && (this.config.group === true || this.config.group.groupHeader)) {
this.table.options.groupHeader = retreivedData.groupHeader;
}
}
}
};
Persistence.prototype.initializeColumn = function (column) {
var self = this,
def,
keys;
if (this.config.columns) {
this.defWatcherBlock = true;
def = column.getDefinition();
keys = this.config.columns === true ? Object.keys(def) : this.config.columns;
keys.forEach(function (key) {
var props = Object.getOwnPropertyDescriptor(def, key);
var value = def[key];
if (props) {
Object.defineProperty(def, key, {
set: function set(newValue) {
value = newValue;
if (!self.defWatcherBlock) {
self.save("columns");
}
if (props.set) {
props.set(newValue);
}
},
get: function get() {
if (props.get) {
props.get();
}
return value;
}
});
}
});
this.defWatcherBlock = false;
}
};
//load saved definitions
Persistence.prototype.load = function (type, current) {
var data = this.retreiveData(type);
if (current) {
data = data ? this.mergeDefinition(current, data) : current;
}
return data;
};
//retreive data from memory
Persistence.prototype.retreiveData = function (type) {
return this.readFunc ? this.readFunc(this.id, type) : false;
};
//merge old and new column definitions
Persistence.prototype.mergeDefinition = function (oldCols, newCols) {
var self = this,
output = [];
// oldCols = oldCols || [];
newCols = newCols || [];
newCols.forEach(function (column, to) {
var from = self._findColumn(oldCols, column),
keys;
if (from) {
if (self.config.columns === true || self.config.columns == undefined) {
keys = Object.keys(from);
keys.push("width");
} else {
keys = self.config.columns;
}
keys.forEach(function (key) {
if (typeof column[key] !== "undefined") {
from[key] = column[key];
}
});
if (from.columns) {
from.columns = self.mergeDefinition(from.columns, column.columns);
}
output.push(from);
}
});
oldCols.forEach(function (column, i) {
var from = self._findColumn(newCols, column);
if (!from) {
if (output.length > i) {
output.splice(i, 0, column);
} else {
output.push(column);
}
}
});
return output;
};
//find matching columns
Persistence.prototype._findColumn = function (columns, subject) {
var type = subject.columns ? "group" : subject.field ? "field" : "object";
return columns.find(function (col) {
switch (type) {
case "group":
return col.title === subject.title && col.columns.length === subject.columns.length;
break;
case "field":
return col.field === subject.field;
break;
case "object":
return col === subject;
break;
}
});
};
//save data
Persistence.prototype.save = function (type) {
var data = {};
switch (type) {
case "columns":
data = this.parseColumns(this.table.columnManager.getColumns());
break;
case "filter":
data = this.table.modules.filter.getFilters();
break;
case "sort":
data = this.validateSorters(this.table.modules.sort.getSort());
break;
case "group":
data = this.getGroupConfig();
break;
case "page":
data = this.getPageConfig();
break;
}
if (this.writeFunc) {
this.writeFunc(this.id, type, data);
}
};
//ensure sorters contain no function data
Persistence.prototype.validateSorters = function (data) {
data.forEach(function (item) {
item.column = item.field;
delete item.field;
});
return data;
};
Persistence.prototype.getGroupConfig = function () {
if (this.config.group) {
if (this.config.group === true || this.config.group.groupBy) {
data.groupBy = this.table.options.groupBy;
}
if (this.config.group === true || this.config.group.groupStartOpen) {
data.groupStartOpen = this.table.options.groupStartOpen;
}
if (this.config.group === true || this.config.group.groupHeader) {
data.groupHeader = this.table.options.groupHeader;
}
}
return data;
};
Persistence.prototype.getPageConfig = function () {
var data = {};
if (this.config.page) {
if (this.config.page === true || this.config.page.size) {
data.paginationSize = this.table.modules.page.getPageSize();
}
if (this.config.page === true || this.config.page.page) {
data.paginationInitialPage = this.table.modules.page.getPage();
}
}
return data;
};
//parse columns for data to store
Persistence.prototype.parseColumns = function (columns) {
var self = this,
definitions = [];
columns.forEach(function (column) {
var defStore = {},
colDef = column.getDefinition(),
keys;
if (column.isGroup) {
defStore.title = colDef.title;
defStore.columns = self.parseColumns(column.getColumns());
} else {
defStore.field = column.getField();
if (self.config.columns === true || self.config.columns == undefined) {
keys = Object.keys(colDef);
keys.push("width");
} else {
keys = self.config.columns;
}
keys.forEach(function (key) {
switch (key) {
case "width":
defStore.width = column.getWidth();
break;
case "visible":
defStore.visible = column.visible;
break;
default:
defStore[key] = colDef[key];
}
});
}
definitions.push(defStore);
});
return definitions;
};
// read peristence information from storage
Persistence.prototype.readers = {
local: function local(id, type) {
var data = localStorage.getItem(id + "-" + type);
return data ? JSON.parse(data) : false;
},
cookie: function cookie(id, type) {
var cookie = document.cookie,
key = id + "-" + type,
cookiePos = cookie.indexOf(key + "="),
end,
data;
//if cookie exists, decode and load column data into tabulator
if (cookiePos > -1) {
cookie = cookie.substr(cookiePos);
end = cookie.indexOf(";");
if (end > -1) {
cookie = cookie.substr(0, end);
}
data = cookie.replace(key + "=", "");
}
return data ? JSON.parse(data) : false;
}
};
//write persistence information to storage
Persistence.prototype.writers = {
local: function local(id, type, data) {
localStorage.setItem(id + "-" + type, JSON.stringify(data));
},
cookie: function cookie(id, type, data) {
var expireDate = new Date();
expireDate.setDate(expireDate.getDate() + 10000);
document.cookie = id + "-" + type + "=" + JSON.stringify(data) + "; expires=" + expireDate.toUTCString();
}
};
Tabulator.prototype.registerModule("persistence", Persistence);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Persistence=function(e){this.table=e,this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1};Persistence.prototype.localStorageTest=function(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}},Persistence.prototype.initialize=function(){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:this.readers[this.table.options.persistenceReaderFunc]?this.readFunc=this.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):this.readers[this.mode]?this.readFunc=this.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:this.readers[this.table.options.persistenceWriterFunc]?this.writeFunc=this.readers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):this.writers[this.mode]?this.writeFunc=this.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))},Persistence.prototype.initializeColumn=function(e){var t,i,s=this;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),i=!0===this.config.columns?Object.keys(t):this.config.columns,i.forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e),o=t[e];i&&Object.defineProperty(t,e,{set:function(e){o=e,s.defWatcherBlock||s.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),o}})}),this.defWatcherBlock=!1)},Persistence.prototype.load=function(e,t){var i=this.retreiveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i},Persistence.prototype.retreiveData=function(e){return!!this.readFunc&&this.readFunc(this.id,e)},Persistence.prototype.mergeDefinition=function(e,t){var i=this,s=[];return t=t||[],t.forEach(function(t,o){var n,r=i._findColumn(e,t);r&&(!0===i.config.columns||void 0==i.config.columns?(n=Object.keys(r),n.push("width")):n=i.config.columns,n.forEach(function(e){void 0!==t[e]&&(r[e]=t[e])}),r.columns&&(r.columns=i.mergeDefinition(r.columns,t.columns)),s.push(r))}),e.forEach(function(e,o){i._findColumn(t,e)||(s.length>o?s.splice(o,0,e):s.push(e))}),s},Persistence.prototype._findColumn=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}})},Persistence.prototype.save=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)},Persistence.prototype.validateSorters=function(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e},Persistence.prototype.getGroupConfig=function(){return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(data.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(data.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||thisLine truncated
@@ -0,0 +1,96 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Print = function Print(table) {
this.table = table; //hold Tabulator object
this.element = false;
this.manualBlock = false;
};
Print.prototype.initialize = function () {
window.addEventListener("beforeprint", this.replaceTable.bind(this));
window.addEventListener("afterprint", this.cleanup.bind(this));
};
Print.prototype.replaceTable = function () {
if (!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);
}
};
Print.prototype.cleanup = function () {
document.body.classList.remove("tabulator-print-fullscreen-hide");
if (this.element && this.element.parentNode) {
this.element.parentNode.removeChild(this.element);
this.table.element.style.display = "";
}
};
Print.prototype.printFullscreen = function (visible, style, config) {
var scrollX = window.scrollX,
scrollY = window.scrollY,
headerEl = document.createElement("div"),
footerEl = document.createElement("div"),
tableEl = this.table.modules.export.genereateTable(typeof config != "undefined" ? config : this.table.options.printConfig, typeof style != "undefined" ? style : this.table.options.printStyled, visible, "print"),
headerContent,
footerContent;
this.manualBlock = true;
this.element = document.createElement("div");
this.element.classList.add("tabulator-print-fullscreen");
if (this.table.options.printHeader) {
headerEl.classList.add("tabulator-print-header");
headerContent = typeof this.table.options.printHeader == "function" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;
if (typeof headerContent == "string") {
headerEl.innerHTML = headerContent;
} else {
headerEl.appendChild(headerContent);
}
this.element.appendChild(headerEl);
}
this.element.appendChild(tableEl);
if (this.table.options.printFooter) {
footerEl.classList.add("tabulator-print-footer");
footerContent = typeof this.table.options.printFooter == "function" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;
if (typeof footerContent == "string") {
footerEl.innerHTML = footerContent;
} else {
footerEl.appendChild(footerContent);
}
this.element.appendChild(footerEl);
}
document.body.classList.add("tabulator-print-fullscreen-hide");
document.body.appendChild(this.element);
if (this.table.options.printFormatter) {
this.table.options.printFormatter(this.element, tableEl);
}
window.print();
this.cleanup();
window.scrollTo(scrollX, scrollY);
this.manualBlock = false;
};
Tabulator.prototype.registerModule("print", Print);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Print=function(t){this.table=t,this.element=!1,this.manualBlock=!1};Print.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))},Print.prototype.replaceTable=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))},Print.prototype.cleanup=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="")},Print.prototype.printFullscreen=function(t,e,i){var n,l,o=window.scrollX,a=window.scrollY,s=document.createElement("div"),r=document.createElement("div"),p=this.table.modules.export.genereateTable(void 0!==i?i:this.table.options.printConfig,void 0!==e?e:this.table.options.printStyled,t,"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"),n="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader,"string"==typeof n?s.innerHTML=n:s.appendChild(n),this.element.appendChild(s)),this.element.appendChild(p),this.table.options.printFooter&&(r.classList.add("tabulator-print-footer"),l="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter,"string"==typeof l?r.innerHTML=l:r.appendChild(l),this.element.appendChild(r)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,p),window.print(),this.cleanup(),window.scrollTo(o,a),this.manualBlock=!1},Tabulator.prototype.registerModule("print",Print);
@@ -0,0 +1,235 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ReactiveData = function ReactiveData(table) {
this.table = table; //hold Tabulator object
this.data = false;
this.blocked = false; //block reactivity while performing update
this.origFuncs = {}; // hold original data array functions to allow replacement after data is done with
this.currentVersion = 0;
};
ReactiveData.prototype.watchData = function (data) {
var self = this,
pushFunc,
version;
this.currentVersion++;
version = this.currentVersion;
self.unwatchData();
self.data = data;
//override array push function
self.origFuncs.push = data.push;
Object.defineProperty(self.data, "push", {
enumerable: false,
configurable: true,
value: function value() {
var args = Array.from(arguments);
if (!self.blocked && version === self.currentVersion) {
args.forEach(function (arg) {
self.table.rowManager.addRowActual(arg, false);
});
}
return self.origFuncs.push.apply(data, arguments);
}
});
//override array unshift function
self.origFuncs.unshift = data.unshift;
Object.defineProperty(self.data, "unshift", {
enumerable: false,
configurable: true,
value: function value() {
var args = Array.from(arguments);
if (!self.blocked && version === self.currentVersion) {
args.forEach(function (arg) {
self.table.rowManager.addRowActual(arg, true);
});
}
return self.origFuncs.unshift.apply(data, arguments);
}
});
//override array shift function
self.origFuncs.shift = data.shift;
Object.defineProperty(self.data, "shift", {
enumerable: false,
configurable: true,
value: function value() {
var row;
if (!self.blocked && version === self.currentVersion) {
if (self.data.length) {
row = self.table.rowManager.getRowFromDataObject(self.data[0]);
if (row) {
row.deleteActual();
}
}
}
return self.origFuncs.shift.call(data);
}
});
//override array pop function
self.origFuncs.pop = data.pop;
Object.defineProperty(self.data, "pop", {
enumerable: false,
configurable: true,
value: function value() {
var row;
if (!self.blocked && version === self.currentVersion) {
if (self.data.length) {
row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);
if (row) {
row.deleteActual();
}
}
}
return self.origFuncs.pop.call(data);
}
});
//override array splice function
self.origFuncs.splice = data.splice;
Object.defineProperty(self.data, "splice", {
enumerable: false,
configurable: true,
value: function value() {
var args = Array.from(arguments),
start = args[0] < 0 ? data.length + args[0] : args[0],
end = args[1],
newRows = args[2] ? args.slice(2) : false,
startRow;
if (!self.blocked && version === self.currentVersion) {
//add new rows
if (newRows) {
startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;
if (startRow) {
newRows.forEach(function (rowData) {
self.table.rowManager.addRowActual(rowData, true, startRow, true);
});
} else {
newRows = newRows.slice().reverse();
newRows.forEach(function (rowData) {
self.table.rowManager.addRowActual(rowData, true, false, true);
});
}
}
//delete removed rows
if (end !== 0) {
var oldRows = data.slice(start, typeof args[1] === "undefined" ? args[1] : start + end);
oldRows.forEach(function (rowData, i) {
var row = self.table.rowManager.getRowFromDataObject(rowData);
if (row) {
row.deleteActual(i !== oldRows.length - 1);
}
});
}
if (newRows || end !== 0) {
self.table.rowManager.reRenderInPosition();
}
}
return self.origFuncs.splice.apply(data, arguments);
}
});
};
ReactiveData.prototype.unwatchData = function () {
if (this.data !== false) {
for (var key in this.origFuncs) {
Object.defineProperty(this.data, key, {
enumerable: true,
configurable: true,
writable: true,
value: this.origFuncs.key
});
}
}
};
ReactiveData.prototype.watchRow = function (row) {
var self = this,
data = row.getData();
this.blocked = true;
for (var key in data) {
this.watchKey(row, data, key);
}
this.blocked = false;
};
ReactiveData.prototype.watchKey = function (row, data, key) {
var self = this,
props = Object.getOwnPropertyDescriptor(data, key),
value = data[key],
version = this.currentVersion;
Object.defineProperty(data, key, {
set: function set(newValue) {
value = newValue;
if (!self.blocked && version === self.currentVersion) {
var update = {};
update[key] = newValue;
row.updateData(update);
}
if (props.set) {
props.set(newValue);
}
},
get: function get() {
if (props.get) {
props.get();
}
return value;
}
});
};
ReactiveData.prototype.unwatchRow = function (row) {
var data = row.getData();
for (var key in data) {
Object.defineProperty(data, key, {
value: data[key]
});
}
};
ReactiveData.prototype.block = function () {
this.blocked = true;
};
ReactiveData.prototype.unblock = function () {
this.blocked = false;
};
Tabulator.prototype.registerModule("reactiveData", ReactiveData);
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ReactiveData=function(e){this.table=e,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};ReactiveData.prototype.watchData=function(e){var t,a=this;this.currentVersion++,t=this.currentVersion,a.unwatchData(),a.data=e,a.origFuncs.push=e.push,Object.defineProperty(a.data,"push",{enumerable:!1,configurable:!0,value:function(){var r=Array.from(arguments);return a.blocked||t!==a.currentVersion||r.forEach(function(e){a.table.rowManager.addRowActual(e,!1)}),a.origFuncs.push.apply(e,arguments)}}),a.origFuncs.unshift=e.unshift,Object.defineProperty(a.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var r=Array.from(arguments);return a.blocked||t!==a.currentVersion||r.forEach(function(e){a.table.rowManager.addRowActual(e,!0)}),a.origFuncs.unshift.apply(e,arguments)}}),a.origFuncs.shift=e.shift,Object.defineProperty(a.data,"shift",{enumerable:!1,configurable:!0,value:function(){var r;return a.blocked||t!==a.currentVersion||a.data.length&&(r=a.table.rowManager.getRowFromDataObject(a.data[0]))&&r.deleteActual(),a.origFuncs.shift.call(e)}}),a.origFuncs.pop=e.pop,Object.defineProperty(a.data,"pop",{enumerable:!1,configurable:!0,value:function(){var r;return a.blocked||t!==a.currentVersion||a.data.length&&(r=a.table.rowManager.getRowFromDataObject(a.data[a.data.length-1]))&&r.deleteActual(),a.origFuncs.pop.call(e)}}),a.origFuncs.splice=e.splice,Object.defineProperty(a.data,"splice",{enumerable:!1,configurable:!0,value:function(){var r,o=Array.from(arguments),n=o[0]<0?e.length+o[0]:o[0],c=o[1],i=!!o[2]&&o.slice(2);if(!a.blocked&&t===a.currentVersion){if(i&&(r=!!e[n]&&a.table.rowManager.getRowFromDataObject(e[n]),r?i.forEach(function(e){a.table.rowManager.addRowActual(e,!0,r,!0)}):(i=i.slice().reverse(),i.forEach(function(e){a.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==c){var u=e.slice(n,void 0===o[1]?o[1]:n+c);u.forEach(function(e,t){var r=a.table.rowManager.getRowFromDataObject(e);r&&r.deleteActual(t!==u.length-1)})}(i||0!==c)&&a.table.rowManager.reRenderInPosition()}return a.origFuncs.splice.apply(e,arguments)}})},ReactiveData.prototype.unwatchData=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})},ReactiveData.prototype.watchRow=function(e){var t=e.getData();this.blocked=!0;for(var a in t)this.watchKey(e,t,a);this.blocked=!1},ReactiveData.prototype.watchKey=function(e,t,a){var r=this,o=Object.getOwnPropertyDescriptor(t,a),n=t[a],c=this.currentVersion;Object.defineProperty(t,a,{set:function(t){if(n=t,!r.blocked&&c===r.currentVersion){var i={};i[a]=t,e.updateData(i)}o.set&&o.set(t)},get:function(){return o.get&&o.get(),n}})},ReactiveData.prototype.unwatchRow=function(e){var t=e.getData();for(var a in t)Object.defineProperty(t,a,{value:t[a]})},ReactiveData.prototype.block=function(){this.blocked=!0},ReactiveData.prototype.unblock=function(){this.blocked=!1},Tabulator.prototype.registerModule("reactiveData",ReactiveData);
@@ -0,0 +1,163 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ResizeColumns = function ResizeColumns(table) {
this.table = table; //hold Tabulator object
this.startColumn = false;
this.startX = false;
this.startWidth = false;
this.handle = null;
this.prevHandle = null;
};
ResizeColumns.prototype.initializeColumn = function (type, column, element) {
var self = this,
variableHeight = false,
mode = this.table.options.resizableColumns;
//set column resize mode
if (type === "header") {
variableHeight = column.definition.formatter == "textarea" || column.definition.variableHeight;
column.modules.resize = { variableHeight: variableHeight };
}
if (mode === true || mode == type) {
var handle = document.createElement('div');
handle.className = "tabulator-col-resize-handle";
var prevHandle = document.createElement('div');
prevHandle.className = "tabulator-col-resize-handle prev";
handle.addEventListener("click", function (e) {
e.stopPropagation();
});
var handleDown = function handleDown(e) {
var nearestColumn = column.getLastColumn();
if (nearestColumn && self._checkResizability(nearestColumn)) {
self.startColumn = column;
self._mouseDown(e, nearestColumn, handle);
}
};
handle.addEventListener("mousedown", handleDown);
handle.addEventListener("touchstart", handleDown, { passive: true });
//reszie column on double click
handle.addEventListener("dblclick", function (e) {
var col = column.getLastColumn();
if (col && self._checkResizability(col)) {
e.stopPropagation();
col.reinitializeWidth(true);
}
});
prevHandle.addEventListener("click", function (e) {
e.stopPropagation();
});
var prevHandleDown = function prevHandleDown(e) {
var nearestColumn, colIndex, prevColumn;
nearestColumn = column.getFirstColumn();
if (nearestColumn) {
colIndex = self.table.columnManager.findColumnIndex(nearestColumn);
prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false;
if (prevColumn && self._checkResizability(prevColumn)) {
self.startColumn = column;
self._mouseDown(e, prevColumn, prevHandle);
}
}
};
prevHandle.addEventListener("mousedown", prevHandleDown);
prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true });
//resize column on double click
prevHandle.addEventListener("dblclick", function (e) {
var nearestColumn, colIndex, prevColumn;
nearestColumn = column.getFirstColumn();
if (nearestColumn) {
colIndex = self.table.columnManager.findColumnIndex(nearestColumn);
prevColumn = colIndex > 0 ? self.table.columnManager.getColumnByIndex(colIndex - 1) : false;
if (prevColumn && self._checkResizability(prevColumn)) {
e.stopPropagation();
prevColumn.reinitializeWidth(true);
}
}
});
element.appendChild(handle);
element.appendChild(prevHandle);
}
};
ResizeColumns.prototype._checkResizability = function (column) {
return typeof column.definition.resizable != "undefined" ? column.definition.resizable : this.table.options.resizableColumns;
};
ResizeColumns.prototype._mouseDown = function (e, column, handle) {
var self = this;
self.table.element.classList.add("tabulator-block-select");
function mouseMove(e) {
// self.table.columnManager.tempScrollBlock();
column.setWidth(self.startWidth + ((typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX) - self.startX));
if (!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) {
column.checkCellHeights();
}
}
function mouseUp(e) {
//block editor from taking action while resizing is taking place
if (self.startColumn.modules.edit) {
self.startColumn.modules.edit.blocked = false;
}
if (self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) {
column.checkCellHeights();
}
document.body.removeEventListener("mouseup", mouseUp);
document.body.removeEventListener("mousemove", mouseMove);
handle.removeEventListener("touchmove", mouseMove);
handle.removeEventListener("touchend", mouseUp);
self.table.element.classList.remove("tabulator-block-select");
if (self.table.options.persistence && self.table.modExists("persistence", true) && self.table.modules.persistence.config.columns) {
self.table.modules.persistence.save("columns");
}
self.table.options.columnResized.call(self.table, column.getComponent());
}
e.stopPropagation(); //prevent resize from interfereing with movable columns
//block editor from taking action while resizing is taking place
if (self.startColumn.modules.edit) {
self.startColumn.modules.edit.blocked = true;
}
self.startX = typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX;
self.startWidth = column.getWidth();
document.body.addEventListener("mousemove", mouseMove);
document.body.addEventListener("mouseup", mouseUp);
handle.addEventListener("touchmove", mouseMove, { passive: true });
handle.addEventListener("touchend", mouseUp);
};
Tabulator.prototype.registerModule("resizeColumns", ResizeColumns);
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ResizeColumns=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};ResizeColumns.prototype.initializeColumn=function(e,t,n){var o=this,i=!1,s=this.table.options.resizableColumns;if("header"===e&&(i="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:i}),!0===s||s==e){var a=document.createElement("div");a.className="tabulator-col-resize-handle";var l=document.createElement("div");l.className="tabulator-col-resize-handle prev",a.addEventListener("click",function(e){e.stopPropagation()});var r=function(e){var n=t.getLastColumn();n&&o._checkResizability(n)&&(o.startColumn=t,o._mouseDown(e,n,a))};a.addEventListener("mousedown",r),a.addEventListener("touchstart",r,{passive:!0}),a.addEventListener("dblclick",function(e){var n=t.getLastColumn();n&&o._checkResizability(n)&&(e.stopPropagation(),n.reinitializeWidth(!0))}),l.addEventListener("click",function(e){e.stopPropagation()});var d=function(e){var n,i,s;(n=t.getFirstColumn())&&(i=o.table.columnManager.findColumnIndex(n),(s=i>0&&o.table.columnManager.getColumnByIndex(i-1))&&o._checkResizability(s)&&(o.startColumn=t,o._mouseDown(e,s,l)))};l.addEventListener("mousedown",d),l.addEventListener("touchstart",d,{passive:!0}),l.addEventListener("dblclick",function(e){var n,i,s;(n=t.getFirstColumn())&&(i=o.table.columnManager.findColumnIndex(n),(s=i>0&&o.table.columnManager.getColumnByIndex(i-1))&&o._checkResizability(s)&&(e.stopPropagation(),s.reinitializeWidth(!0)))}),n.appendChild(a),n.appendChild(l)}},ResizeColumns.prototype._checkResizability=function(e){return void 0!==e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},ResizeColumns.prototype._mouseDown=function(e,t,n){function o(e){t.setWidth(s.startWidth+((void 0===e.screenX?e.touches[0].screenX:e.screenX)-s.startX)),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function i(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",i),document.body.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),n.removeEventListener("touchend",i),s.table.element.classList.remove("tabulator-block-select"),s.table.options.persistence&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.config.columns&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,t.getComponent())}var s=this;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.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",i),n.addEventListener("touchmove",o,{passive:!0}),n.addEventListener("touchend",i)},Tabulator.prototype.registerModule("resizeColumns",ResizeColumns);
@@ -0,0 +1,98 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ResizeRows = function ResizeRows(table) {
this.table = table; //hold Tabulator object
this.startColumn = false;
this.startY = false;
this.startHeight = false;
this.handle = null;
this.prevHandle = null;
};
ResizeRows.prototype.initializeRow = function (row) {
var self = this,
rowEl = row.getElement();
var handle = document.createElement('div');
handle.className = "tabulator-row-resize-handle";
var prevHandle = document.createElement('div');
prevHandle.className = "tabulator-row-resize-handle prev";
handle.addEventListener("click", function (e) {
e.stopPropagation();
});
var handleDown = function handleDown(e) {
self.startRow = row;
self._mouseDown(e, row, handle);
};
handle.addEventListener("mousedown", handleDown);
handle.addEventListener("touchstart", handleDown, { passive: true });
prevHandle.addEventListener("click", function (e) {
e.stopPropagation();
});
var prevHandleDown = function prevHandleDown(e) {
var prevRow = self.table.rowManager.prevDisplayRow(row);
if (prevRow) {
self.startRow = prevRow;
self._mouseDown(e, prevRow, prevHandle);
}
};
prevHandle.addEventListener("mousedown", prevHandleDown);
prevHandle.addEventListener("touchstart", prevHandleDown, { passive: true });
rowEl.appendChild(handle);
rowEl.appendChild(prevHandle);
};
ResizeRows.prototype._mouseDown = function (e, row, handle) {
var self = this;
self.table.element.classList.add("tabulator-block-select");
function mouseMove(e) {
row.setHeight(self.startHeight + ((typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY) - self.startY));
}
function mouseUp(e) {
// //block editor from taking action while resizing is taking place
// if(self.startColumn.modules.edit){
// self.startColumn.modules.edit.blocked = false;
// }
document.body.removeEventListener("mouseup", mouseMove);
document.body.removeEventListener("mousemove", mouseMove);
handle.removeEventListener("touchmove", mouseMove);
handle.removeEventListener("touchend", mouseUp);
self.table.element.classList.remove("tabulator-block-select");
self.table.options.rowResized.call(this.table, row.getComponent());
}
e.stopPropagation(); //prevent resize from interfereing with movable columns
//block editor from taking action while resizing is taking place
// if(self.startColumn.modules.edit){
// self.startColumn.modules.edit.blocked = true;
// }
self.startY = typeof e.screenY === "undefined" ? e.touches[0].screenY : e.screenY;
self.startHeight = row.getHeight();
document.body.addEventListener("mousemove", mouseMove);
document.body.addEventListener("mouseup", mouseUp);
handle.addEventListener("touchmove", mouseMove, { passive: true });
handle.addEventListener("touchend", mouseUp);
};
Tabulator.prototype.registerModule("resizeRows", ResizeRows);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ResizeRows=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};ResizeRows.prototype.initializeRow=function(e){var t=this,o=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(e){e.stopPropagation()});var a=function(o){t.startRow=e,t._mouseDown(o,e,s)};s.addEventListener("mousedown",a),s.addEventListener("touchstart",a,{passive:!0}),n.addEventListener("click",function(e){e.stopPropagation()});var r=function(o){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(o,s,n))};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r,{passive:!0}),o.appendChild(s),o.appendChild(n)},ResizeRows.prototype._mouseDown=function(e,t,o){function s(e){t.setHeight(a.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-a.startY))}function n(e){document.body.removeEventListener("mouseup",s),document.body.removeEventListener("mousemove",s),o.removeEventListener("touchmove",s),o.removeEventListener("touchend",n),a.table.element.classList.remove("tabulator-block-select"),a.table.options.rowResized.call(this.table,t.getComponent())}var a=this;a.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),a.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,a.startHeight=t.getHeight(),document.body.addEventListener("mousemove",s),document.body.addEventListener("mouseup",n),o.addEventListener("touchmove",s,{passive:!0}),o.addEventListener("touchend",n)},Tabulator.prototype.registerModule("resizeRows",ResizeRows);
@@ -0,0 +1,107 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ResizeTable = function ResizeTable(table) {
this.table = table; //hold Tabulator object
this.binding = false;
this.observer = false;
this.containerObserver = false;
this.tableHeight = 0;
this.tableWidth = 0;
this.containerHeight = 0;
this.containerWidth = 0;
this.autoResize = false;
};
ResizeTable.prototype.initialize = function (row) {
var _this = this;
var table = this.table,
tableStyle;
this.tableHeight = table.element.clientHeight;
this.tableWidth = table.element.clientWidth;
if (table.element.parentNode) {
this.containerHeight = table.element.parentNode.clientHeight;
this.containerWidth = table.element.parentNode.clientWidth;
}
if (typeof ResizeObserver !== "undefined" && table.rowManager.getRenderMode() === "virtual") {
this.autoResize = true;
this.observer = new ResizeObserver(function (entry) {
if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) {
var nodeHeight = Math.floor(entry[0].contentRect.height);
var nodeWidth = Math.floor(entry[0].contentRect.width);
if (_this.tableHeight != nodeHeight || _this.tableWidth != nodeWidth) {
_this.tableHeight = nodeHeight;
_this.tableWidth = nodeWidth;
if (table.element.parentNode) {
_this.containerHeight = table.element.parentNode.clientHeight;
_this.containerWidth = table.element.parentNode.clientWidth;
}
table.redraw();
}
}
});
this.observer.observe(table.element);
tableStyle = window.getComputedStyle(table.element);
if (this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue("max-height") || tableStyle.getPropertyValue("min-height"))) {
this.containerObserver = new ResizeObserver(function (entry) {
if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) {
var nodeHeight = Math.floor(entry[0].contentRect.height);
var nodeWidth = Math.floor(entry[0].contentRect.width);
if (_this.containerHeight != nodeHeight || _this.containerWidth != nodeWidth) {
_this.containerHeight = nodeHeight;
_this.containerWidth = nodeWidth;
_this.tableHeight = table.element.clientHeight;
_this.tableWidth = table.element.clientWidth;
table.redraw();
}
table.redraw();
}
});
this.containerObserver.observe(this.table.element.parentNode);
}
} else {
this.binding = function () {
if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) {
table.redraw();
}
};
window.addEventListener("resize", this.binding);
}
};
ResizeTable.prototype.clearBindings = function (row) {
if (this.binding) {
window.removeEventListener("resize", this.binding);
}
if (this.observer) {
this.observer.unobserve(this.table.element);
}
if (this.containerObserver) {
this.containerObserver.unobserve(this.table.element.parentNode);
}
};
Tabulator.prototype.registerModule("resizeTable", ResizeTable);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ResizeTable=function(e){this.table=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};ResizeTable.prototype.initialize=function(e){var t,i=this,n=this.table;this.tableHeight=n.element.clientHeight,this.tableWidth=n.element.clientWidth,n.element.parentNode&&(this.containerHeight=n.element.parentNode.clientHeight,this.containerWidth=n.element.parentNode.clientWidth),"undefined"!=typeof ResizeObserver&&"virtual"===n.rowManager.getRenderMode()?(this.autoResize=!0,this.observer=new ResizeObserver(function(e){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),r=Math.floor(e[0].contentRect.width);i.tableHeight==t&&i.tableWidth==r||(i.tableHeight=t,i.tableWidth=r,n.element.parentNode&&(i.containerHeight=n.element.parentNode.clientHeight,i.containerWidth=n.element.parentNode.clientWidth),n.redraw())}}),this.observer.observe(n.element),t=window.getComputedStyle(n.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(e){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var t=Math.floor(e[0].contentRect.height),r=Math.floor(e[0].contentRect.width);i.containerHeight==t&&i.containerWidth==r||(i.containerHeight=t,i.containerWidth=r,i.tableHeight=n.element.clientHeight,i.tableWidth=n.element.clientWidth,n.redraw()),n.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell)&&n.redraw()},window.addEventListener("resize",this.binding))},ResizeTable.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)},Tabulator.prototype.registerModule("resizeTable",ResizeTable);
@@ -0,0 +1,301 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ResponsiveLayout = function ResponsiveLayout(table) {
this.table = table; //hold Tabulator object
this.columns = [];
this.hiddenColumns = [];
this.mode = "";
this.index = 0;
this.collapseFormatter = [];
this.collapseStartOpen = true;
this.collapseHandleColumn = false;
};
//generate resposive columns list
ResponsiveLayout.prototype.initialize = function () {
var self = this,
columns = [];
this.mode = this.table.options.responsiveLayout;
this.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;
this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;
this.hiddenColumns = [];
//detemine level of responsivity for each column
this.table.columnManager.columnsByIndex.forEach(function (column, i) {
if (column.modules.responsive) {
if (column.modules.responsive.order && column.modules.responsive.visible) {
column.modules.responsive.index = i;
columns.push(column);
if (!column.visible && self.mode === "collapse") {
self.hiddenColumns.push(column);
}
}
}
});
//sort list by responsivity
columns = columns.reverse();
columns = columns.sort(function (a, b) {
var diff = b.modules.responsive.order - a.modules.responsive.order;
return diff || b.modules.responsive.index - a.modules.responsive.index;
});
this.columns = columns;
if (this.mode === "collapse") {
this.generateCollapsedContent();
}
//assign collapse column
for (var _iterator = this.table.columnManager.columnsByIndex, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var col = _ref;
if (col.definition.formatter == "responsiveCollapse") {
this.collapseHandleColumn = col;
break;
}
}
if (this.collapseHandleColumn) {
if (this.hiddenColumns.length) {
this.collapseHandleColumn.show();
} else {
this.collapseHandleColumn.hide();
}
}
};
//define layout information
ResponsiveLayout.prototype.initializeColumn = function (column) {
var def = column.getDefinition();
column.modules.responsive = { order: typeof def.responsive === "undefined" ? 1 : def.responsive, visible: def.visible === false ? false : true };
};
ResponsiveLayout.prototype.initializeRow = function (row) {
var el;
if (row.type !== "calc") {
el = document.createElement("div");
el.classList.add("tabulator-responsive-collapse");
row.modules.responsiveLayout = {
element: el,
open: this.collapseStartOpen
};
if (!this.collapseStartOpen) {
el.style.display = 'none';
}
}
};
ResponsiveLayout.prototype.layoutRow = function (row) {
var rowEl = row.getElement();
if (row.modules.responsiveLayout) {
rowEl.appendChild(row.modules.responsiveLayout.element);
this.generateCollapsedRowContent(row);
}
};
//update column visibility
ResponsiveLayout.prototype.updateColumnVisibility = function (column, visible) {
var index;
if (column.modules.responsive) {
column.modules.responsive.visible = visible;
this.initialize();
}
};
ResponsiveLayout.prototype.hideColumn = function (column) {
var colCount = this.hiddenColumns.length;
column.hide(false, true);
if (this.mode === "collapse") {
this.hiddenColumns.unshift(column);
this.generateCollapsedContent();
if (this.collapseHandleColumn && !colCount) {
this.collapseHandleColumn.show();
}
}
};
ResponsiveLayout.prototype.showColumn = function (column) {
var index;
column.show(false, true);
//set column width to prevent calculation loops on uninitialized columns
column.setWidth(column.getWidth());
if (this.mode === "collapse") {
index = this.hiddenColumns.indexOf(column);
if (index > -1) {
this.hiddenColumns.splice(index, 1);
}
this.generateCollapsedContent();
if (this.collapseHandleColumn && !this.hiddenColumns.length) {
this.collapseHandleColumn.hide();
}
}
};
//redraw columns to fit space
ResponsiveLayout.prototype.update = function () {
var self = this,
working = true;
while (working) {
var width = self.table.modules.layout.getMode() == "fitColumns" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();
var diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;
if (diff < 0) {
//table is too wide
var column = self.columns[self.index];
if (column) {
self.hideColumn(column);
self.index++;
} else {
working = false;
}
} else {
//table has spare space
var _column = self.columns[self.index - 1];
if (_column) {
if (diff > 0) {
if (diff >= _column.getWidth()) {
self.showColumn(_column);
self.index--;
} else {
working = false;
}
} else {
working = false;
}
} else {
working = false;
}
}
if (!self.table.rowManager.activeRowsCount) {
self.table.rowManager.renderEmptyScroll();
}
}
};
ResponsiveLayout.prototype.generateCollapsedContent = function () {
var self = this,
rows = this.table.rowManager.getDisplayRows();
rows.forEach(function (row) {
self.generateCollapsedRowContent(row);
});
};
ResponsiveLayout.prototype.generateCollapsedRowContent = function (row) {
var el, contents;
if (row.modules.responsiveLayout) {
el = row.modules.responsiveLayout.element;
while (el.firstChild) {
el.removeChild(el.firstChild);
}contents = this.collapseFormatter(this.generateCollapsedRowData(row));
if (contents) {
el.appendChild(contents);
}
}
};
ResponsiveLayout.prototype.generateCollapsedRowData = function (row) {
var self = this,
data = row.getData(),
output = [],
mockCellComponent;
this.hiddenColumns.forEach(function (column) {
var value = column.getFieldValue(data);
if (column.definition.title && column.field) {
if (column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters) {
mockCellComponent = {
value: false,
data: {},
getValue: function getValue() {
return value;
},
getData: function getData() {
return data;
},
getElement: function getElement() {
return document.createElement("div");
},
getRow: function getRow() {
return row.getComponent();
},
getColumn: function getColumn() {
return column.getComponent();
}
};
output.push({
title: column.definition.title,
value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params)
});
} else {
output.push({
title: column.definition.title,
value: value
});
}
}
});
return output;
};
ResponsiveLayout.prototype.formatCollapsedData = function (data) {
var list = document.createElement("table"),
listContents = "";
data.forEach(function (item) {
var div = document.createElement("div");
if (item.value instanceof Node) {
div.appendChild(item.value);
item.value = div.innerHTML;
}
listContents += "<tr><td><strong>" + item.title + "</strong></td><td>" + item.value + "</td></tr>";
});
list.innerHTML = listContents;
return Object.keys(data).length ? list : "";
};
Tabulator.prototype.registerModule("responsiveLayout", ResponsiveLayout);
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var ResponsiveLayout=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};ResponsiveLayout.prototype.initialize=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(o,n){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=n,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))}),t=t.reverse(),t=t.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();for(var o=this.table.columnManager.columnsByIndex,n=Array.isArray(o),s=0,o=n?o:o[Symbol.iterator]();;){var i;if(n){if(s>=o.length)break;i=o[s++]}else{if(s=o.next(),s.done)break;i=s.value}var l=i;if("responsiveCollapse"==l.definition.formatter){this.collapseHandleColumn=l;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())},ResponsiveLayout.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},ResponsiveLayout.prototype.initializeRow=function(e){var t;"calc"!==e.type&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))},ResponsiveLayout.prototype.layoutRow=function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))},ResponsiveLayout.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},ResponsiveLayout.prototype.hideColumn=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())},ResponsiveLayout.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())},ResponsiveLayout.prototype.update=function(){for(var e=this,t=!0;t;){var o="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)-o;if(n<0){var s=e.columns[e.index];s?(e.hideColumn(s),e.index++):t=!1}else{var i=e.columns[e.index-1];i&&n>0&&n>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},ResponsiveLayout.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},ResponsiveLayout.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},ResponsiveLayout.prototype.generateCollapsedRowData=function(e){var t,o=this,n=e.getData(),s=[];return this.hiddenColumns.forEach(function(i){var l=i.getFieldValue(n);i.definition.title&&i.field&&(i.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return l},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return i.getComponent()}},s.push({title:i.definition.title,value:i.modules.format.formatter.call(o.table.modules.format,t,i.modules.format.params)})):s.push({title:i.definition.title,value:l}))}),s},ResponsiveLayout.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";return e.forEach(function(e){var t=document.createElement("div");e.value instanceof Node&&(t.appendChild(e.value),e.value=t.innerHTML),o+="<tr><td><strong>"+e.title+"</strong></td><td>"+e.value+"</td></tr>"}),t.innerHTML=o,Object.keys(e).length?t:""},Tabulator.prototype.registerModule("responsiveLayout",ResponsiveLayout);
@@ -0,0 +1,417 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var SelectRow = function SelectRow(table) {
this.table = table; //hold Tabulator object
this.selecting = false; //flag selecting in progress
this.lastClickedRow = false; //last clicked row
this.selectPrev = []; //hold previously selected element for drag drop selection
this.selectedRows = []; //hold selected rows
this.headerCheckboxElement = null; // hold header select element
};
SelectRow.prototype.clearSelectionData = function (silent) {
this.selecting = false;
this.lastClickedRow = false;
this.selectPrev = [];
this.selectedRows = [];
if (!silent) {
this._rowSelectionChanged();
}
};
SelectRow.prototype.initializeRow = function (row) {
var self = this,
element = row.getElement();
// trigger end of row selection
var endSelect = function endSelect() {
setTimeout(function () {
self.selecting = false;
}, 50);
document.body.removeEventListener("mouseup", endSelect);
};
row.modules.select = { selected: false };
//set row selection class
if (self.table.options.selectableCheck.call(this.table, row.getComponent())) {
element.classList.add("tabulator-selectable");
element.classList.remove("tabulator-unselectable");
if (self.table.options.selectable && self.table.options.selectable != "highlight") {
if (self.table.options.selectableRangeMode === "click") {
element.addEventListener("click", function (e) {
if (e.shiftKey) {
self.table._clearSelection();
self.lastClickedRow = self.lastClickedRow || row;
var lastClickedRowIdx = self.table.rowManager.getDisplayRowIndex(self.lastClickedRow);
var rowIdx = self.table.rowManager.getDisplayRowIndex(row);
var fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;
var toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;
var rows = self.table.rowManager.getDisplayRows().slice(0);
var toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);
if (e.ctrlKey || e.metaKey) {
toggledRows.forEach(function (toggledRow) {
if (toggledRow !== self.lastClickedRow) {
if (self.table.options.selectable !== true && !self.isRowSelected(row)) {
if (self.selectedRows.length < self.table.options.selectable) {
self.toggleRow(toggledRow);
}
} else {
self.toggleRow(toggledRow);
}
}
});
self.lastClickedRow = row;
} else {
self.deselectRows(undefined, true);
if (self.table.options.selectable !== true) {
if (toggledRows.length > self.table.options.selectable) {
toggledRows = toggledRows.slice(0, self.table.options.selectable);
}
}
self.selectRows(toggledRows);
}
self.table._clearSelection();
} else if (e.ctrlKey || e.metaKey) {
self.toggleRow(row);
self.lastClickedRow = row;
} else {
self.deselectRows(undefined, true);
self.selectRows(row);
self.lastClickedRow = row;
}
});
} else {
element.addEventListener("click", function (e) {
if (!self.table.modExists("edit") || !self.table.modules.edit.getCurrentCell()) {
self.table._clearSelection();
}
if (!self.selecting) {
self.toggleRow(row);
}
});
element.addEventListener("mousedown", function (e) {
if (e.shiftKey) {
self.table._clearSelection();
self.selecting = true;
self.selectPrev = [];
document.body.addEventListener("mouseup", endSelect);
document.body.addEventListener("keyup", endSelect);
self.toggleRow(row);
return false;
}
});
element.addEventListener("mouseenter", function (e) {
if (self.selecting) {
self.table._clearSelection();
self.toggleRow(row);
if (self.selectPrev[1] == row) {
self.toggleRow(self.selectPrev[0]);
}
}
});
element.addEventListener("mouseout", function (e) {
if (self.selecting) {
self.table._clearSelection();
self.selectPrev.unshift(row);
}
});
}
}
} else {
element.classList.add("tabulator-unselectable");
element.classList.remove("tabulator-selectable");
}
};
//toggle row selection
SelectRow.prototype.toggleRow = function (row) {
if (this.table.options.selectableCheck.call(this.table, row.getComponent())) {
if (row.modules.select && row.modules.select.selected) {
this._deselectRow(row);
} else {
this._selectRow(row);
}
}
};
//select a number of rows
SelectRow.prototype.selectRows = function (rows) {
var _this = this;
var rowMatch;
switch (typeof rows === "undefined" ? "undefined" : _typeof(rows)) {
case "undefined":
this.table.rowManager.rows.forEach(function (row) {
_this._selectRow(row, true, true);
});
this._rowSelectionChanged();
break;
case "string":
rowMatch = this.table.rowManager.findRow(rows);
if (rowMatch) {
this._selectRow(rowMatch, true, true);
} else {
this.table.rowManager.getRows(rows).forEach(function (row) {
_this._selectRow(row, true, true);
});
}
this._rowSelectionChanged();
break;
default:
if (Array.isArray(rows)) {
rows.forEach(function (row) {
_this._selectRow(row, true, true);
});
this._rowSelectionChanged();
} else {
this._selectRow(rows, false, true);
}
break;
}
};
//select an individual row
SelectRow.prototype._selectRow = function (rowInfo, silent, force) {
var index;
//handle max row count
if (!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force) {
if (this.selectedRows.length >= this.table.options.selectable) {
if (this.table.options.selectableRollingSelection) {
this._deselectRow(this.selectedRows[0]);
} else {
return false;
}
}
}
var row = this.table.rowManager.findRow(rowInfo);
if (row) {
if (this.selectedRows.indexOf(row) == -1) {
if (!row.modules.select) {
row.modules.select = {};
}
row.modules.select.selected = true;
if (row.modules.select.checkboxEl) {
row.modules.select.checkboxEl.checked = true;
}
row.getElement().classList.add("tabulator-selected");
this.selectedRows.push(row);
if (this.table.options.dataTreeSelectPropagate) {
this.childRowSelection(row, true);
}
if (!silent) {
this.table.options.rowSelected.call(this.table, row.getComponent());
}
this._rowSelectionChanged(silent);
}
} else {
if (!silent) {
console.warn("Selection Error - No such row found, ignoring selection:" + rowInfo);
}
}
};
SelectRow.prototype.isRowSelected = function (row) {
return this.selectedRows.indexOf(row) !== -1;
};
//deselect a number of rows
SelectRow.prototype.deselectRows = function (rows, silent) {
var self = this,
rowCount;
if (typeof rows == "undefined") {
rowCount = self.selectedRows.length;
for (var i = 0; i < rowCount; i++) {
self._deselectRow(self.selectedRows[0], true);
}
self._rowSelectionChanged(silent);
} else {
if (Array.isArray(rows)) {
rows.forEach(function (row) {
self._deselectRow(row, true);
});
self._rowSelectionChanged(silent);
} else {
self._deselectRow(rows, silent);
}
}
};
//deselect an individual row
SelectRow.prototype._deselectRow = function (rowInfo, silent) {
var self = this,
row = self.table.rowManager.findRow(rowInfo),
index;
if (row) {
index = self.selectedRows.findIndex(function (selectedRow) {
return selectedRow == row;
});
if (index > -1) {
if (!row.modules.select) {
row.modules.select = {};
}
row.modules.select.selected = false;
if (row.modules.select.checkboxEl) {
row.modules.select.checkboxEl.checked = false;
}
row.getElement().classList.remove("tabulator-selected");
self.selectedRows.splice(index, 1);
if (this.table.options.dataTreeSelectPropagate) {
this.childRowSelection(row, false);
}
if (!silent) {
self.table.options.rowDeselected.call(this.table, row.getComponent());
}
self._rowSelectionChanged(silent);
}
} else {
if (!silent) {
console.warn("Deselection Error - No such row found, ignoring selection:" + rowInfo);
}
}
};
SelectRow.prototype.getSelectedData = function () {
var data = [];
this.selectedRows.forEach(function (row) {
data.push(row.getData());
});
return data;
};
SelectRow.prototype.getSelectedRows = function () {
var rows = [];
this.selectedRows.forEach(function (row) {
rows.push(row.getComponent());
});
return rows;
};
SelectRow.prototype._rowSelectionChanged = function (silent) {
if (this.headerCheckboxElement) {
if (this.selectedRows.length === 0) {
this.headerCheckboxElement.checked = false;
this.headerCheckboxElement.indeterminate = false;
} else if (this.table.rowManager.rows.length === this.selectedRows.length) {
this.headerCheckboxElement.checked = true;
this.headerCheckboxElement.indeterminate = false;
} else {
this.headerCheckboxElement.indeterminate = true;
this.headerCheckboxElement.checked = false;
}
}
if (!silent) {
this.table.options.rowSelectionChanged.call(this.table, this.getSelectedData(), this.getSelectedRows());
}
};
SelectRow.prototype.registerRowSelectCheckbox = function (row, element) {
if (!row._row.modules.select) {
row._row.modules.select = {};
}
row._row.modules.select.checkboxEl = element;
};
SelectRow.prototype.registerHeaderSelectCheckbox = function (element) {
this.headerCheckboxElement = element;
};
SelectRow.prototype.childRowSelection = function (row, select) {
var children = this.table.modules.dataTree.getChildren(row);
if (select) {
for (var _iterator = children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var child = _ref;
this._selectRow(child, true);
}
} else {
for (var _iterator2 = children, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
} else {
_i2 = _iterator2.next();
if (_i2.done) break;
_ref2 = _i2.value;
}
var _child = _ref2;
this._deselectRow(_child, true);
}
}
};
Tabulator.prototype.registerModule("selectRow", SelectRow);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="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},SelectRow=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};SelectRow.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},SelectRow.prototype.initializeRow=function(e){var t=this,o=e.getElement(),l=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())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){t.table._clearSelection(),t.lastClickedRow=t.lastClickedRow||e;var l=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),s=t.table.rowManager.getDisplayRowIndex(e),c=l<=s?l:s,i=l>=s?l:s,n=t.table.rowManager.getDisplayRows().slice(0),a=n.splice(c,i-c+1);o.ctrlKey||o.metaKey?(a.forEach(function(o){o!==t.lastClickedRow&&(!0===t.table.options.selectable||t.isRowSelected(e)?t.toggleRow(o):t.selectedRows.length<t.table.options.selectable&&t.toggleRow(o))}),t.lastClickedRow=e):(t.deselectRows(void 0,!0),!0!==t.table.options.selectable&&a.length>t.table.options.selectable&&(a=a.slice(0,t.table.options.selectable)),t.selectRows(a)),t.table._clearSelection()}else o.ctrlKey||o.metaKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(void 0,!0),t.selectRows(e),t.lastClickedRow=e)}):(o.addEventListener("click",function(o){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",l),document.body.addEventListener("keyup",l),t.toggleRow(e),!1}),o.addEventListener("mouseenter",function(o){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),o.addEventListener("mouseout",function(o){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},SelectRow.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},SelectRow.prototype.selectRows=function(e){var t,o=this;switch(void 0===e?"undefined":_typeof(e)){case"undefined":this.table.rowManager.rows.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;case"string":t=this.table.rowManager.findRow(e),t?this._selectRow(t,!0,!0):this.table.rowManager.getRows(e).forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(e)?(e.forEach(function(e){o._selectRow(e,!0,!0)}),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}},SelectRow.prototype._selectRow=function(e,t,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var l=this.table.rowManager.findRow(e);l?-1==this.selectedRows.indexOf(l)&&(l.modules.select||(l.modules.select={}),l.modules.select.selected=!0,l.modules.select.checkboxEl&&(l.modules.select.checkboxEl.checked=!0),l.getElement().classList.add("tabulator-selected"),this.selectedRows.push(l),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(l,!0),t||this.table.options.rowSelected.call(this.table,l.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},SelectRow.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},SelectRow.prototype.deselectRows=function(e,t){var o,l=this;if(void 0===e){o=l.selectedRows.length;for(var s=0;s<o;s++)l._deselectRow(l.selectedRows[0],!0);l._rowSelectionChanged(t)}else Array.isArray(e)?(e.forEach(function(e){l._deselectRow(e,!0)}),l._rowSelectionChanged(t)):l._deselectRow(e,t)},SelectRow.prototype._deselectRow=function(e,t){var o,l=this,s=l.table.rowManager.findRow(e);s?(o=l.selectedRows.findIndex(function(e){return e==s}))>-1&&(s.modules.select||(s.modules.select={}),s.modules.select.selected=!1,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!1),s.getElement().classList.remove("tabulator-selected"),l.selectedRows.splice(o,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!1),t||l.table.options.roLine truncated
+566
View File
@@ -0,0 +1,566 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Sort = function Sort(table) {
this.table = table; //hold Tabulator object
this.sortList = []; //holder current sort
this.changed = false; //has the sort changed since last render
};
//initialize column header for sorting
Sort.prototype.initializeColumn = function (column, content) {
var self = this,
sorter = false,
colEl,
arrowEl;
switch (_typeof(column.definition.sorter)) {
case "string":
if (self.sorters[column.definition.sorter]) {
sorter = self.sorters[column.definition.sorter];
} else {
console.warn("Sort Error - No such sorter found: ", column.definition.sorter);
}
break;
case "function":
sorter = column.definition.sorter;
break;
}
column.modules.sort = {
sorter: sorter, dir: "none",
params: column.definition.sorterParams || {},
startingDir: column.definition.headerSortStartingDir || "asc",
tristate: typeof column.definition.headerSortTristate !== "undefined" ? column.definition.headerSortTristate : this.table.options.headerSortTristate
};
if (typeof column.definition.headerSort === "undefined" ? this.table.options.headerSort !== false : column.definition.headerSort !== false) {
colEl = column.getElement();
colEl.classList.add("tabulator-sortable");
arrowEl = document.createElement("div");
arrowEl.classList.add("tabulator-arrow");
//create sorter arrow
content.appendChild(arrowEl);
//sort on click
colEl.addEventListener("click", function (e) {
var dir = "",
sorters = [],
match = false;
if (column.modules.sort) {
if (column.modules.sort.tristate) {
if (column.modules.sort.dir == "none") {
dir = column.modules.sort.startingDir;
} else {
if (column.modules.sort.dir == column.modules.sort.startingDir) {
dir = column.modules.sort.dir == "asc" ? "desc" : "asc";
} else {
dir = "none";
}
}
} else {
switch (column.modules.sort.dir) {
case "asc":
dir = "desc";
break;
case "desc":
dir = "asc";
break;
default:
dir = column.modules.sort.startingDir;
}
}
if (self.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {
sorters = self.getSort();
match = sorters.findIndex(function (sorter) {
return sorter.field === column.getField();
});
if (match > -1) {
sorters[match].dir = dir;
if (match != sorters.length - 1) {
match = sorters.splice(match, 1)[0];
if (dir != "none") {
sorters.push(match);
}
}
} else {
if (dir != "none") {
sorters.push({ column: column, dir: dir });
}
}
//add to existing sort
self.setSort(sorters);
} else {
if (dir == "none") {
self.clear();
} else {
//sort by column only
self.setSort(column, dir);
}
}
self.table.rowManager.sorterRefresh(!self.sortList.length);
}
});
}
};
//check if the sorters have changed since last use
Sort.prototype.hasChanged = function () {
var changed = this.changed;
this.changed = false;
return changed;
};
//return current sorters
Sort.prototype.getSort = function () {
var self = this,
sorters = [];
self.sortList.forEach(function (item) {
if (item.column) {
sorters.push({ column: item.column.getComponent(), field: item.column.getField(), dir: item.dir });
}
});
return sorters;
};
//change sort list and trigger sort
Sort.prototype.setSort = function (sortList, dir) {
var self = this,
newSortList = [];
if (!Array.isArray(sortList)) {
sortList = [{ column: sortList, dir: dir }];
}
sortList.forEach(function (item) {
var column;
column = self.table.columnManager.findColumn(item.column);
if (column) {
item.column = column;
newSortList.push(item);
self.changed = true;
} else {
console.warn("Sort Warning - Sort field does not exist and is being ignored: ", item.column);
}
});
self.sortList = newSortList;
if (this.table.options.persistence && this.table.modExists("persistence", true) && this.table.modules.persistence.config.sort) {
this.table.modules.persistence.save("sort");
}
};
//clear sorters
Sort.prototype.clear = function () {
this.setSort([]);
};
//find appropriate sorter for column
Sort.prototype.findSorter = function (column) {
var row = this.table.rowManager.activeRows[0],
sorter = "string",
field,
value;
if (row) {
row = row.getData();
field = column.getField();
if (field) {
value = column.getFieldValue(row);
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) {
case "undefined":
sorter = "string";
break;
case "boolean":
sorter = "boolean";
break;
default:
if (!isNaN(value) && value !== "") {
sorter = "number";
} else {
if (value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)) {
sorter = "alphanum";
}
}
break;
}
}
}
return this.sorters[sorter];
};
//work through sort list sorting data
Sort.prototype.sort = function (data) {
var self = this,
sortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,
sortListActual = [],
lastSort;
if (self.table.options.dataSorting) {
self.table.options.dataSorting.call(self.table, self.getSort());
}
self.clearColumnHeaders();
if (!self.table.options.ajaxSorting) {
//build list of valid sorters and trigger column specific callbacks before sort begins
sortList.forEach(function (item, i) {
var sortObj = item.column.modules.sort;
if (item.column && sortObj) {
//if no sorter has been defined, take a guess
if (!sortObj.sorter) {
sortObj.sorter = self.findSorter(item.column);
}
item.params = typeof sortObj.params === "function" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;
sortListActual.push(item);
}
self.setColumnHeader(item.column, item.dir);
});
//sort data
if (sortListActual.length) {
self._sortItems(data, sortListActual);
}
} else {
sortList.forEach(function (item, i) {
self.setColumnHeader(item.column, item.dir);
});
}
if (self.table.options.dataSorted) {
self.table.options.dataSorted.call(self.table, self.getSort(), self.table.rowManager.getComponents("active"));
}
};
//clear sort arrows on columns
Sort.prototype.clearColumnHeaders = function () {
this.table.columnManager.getRealColumns().forEach(function (column) {
if (column.modules.sort) {
column.modules.sort.dir = "none";
column.getElement().setAttribute("aria-sort", "none");
}
});
};
//set the column header sort direction
Sort.prototype.setColumnHeader = function (column, dir) {
column.modules.sort.dir = dir;
column.getElement().setAttribute("aria-sort", dir);
};
//sort each item in sort list
Sort.prototype._sortItems = function (data, sortList) {
var _this = this;
var sorterCount = sortList.length - 1;
data.sort(function (a, b) {
var result;
for (var i = sorterCount; i >= 0; i--) {
var sortItem = sortList[i];
result = _this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);
if (result !== 0) {
break;
}
}
return result;
});
};
//process individual rows for a sort function on active data
Sort.prototype._sortRow = function (a, b, column, dir, params) {
var el1Comp, el2Comp, colComp;
//switch elements depending on search direction
var el1 = dir == "asc" ? a : b;
var el2 = dir == "asc" ? b : a;
a = column.getFieldValue(el1.getData());
b = column.getFieldValue(el2.getData());
a = typeof a !== "undefined" ? a : "";
b = typeof b !== "undefined" ? b : "";
el1Comp = el1.getComponent();
el2Comp = el2.getComponent();
return column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);
};
//default data sorters
Sort.prototype.sorters = {
//sort numbers
number: function number(a, b, aRow, bRow, column, dir, params) {
var alignEmptyValues = params.alignEmptyValues;
var decimal = params.decimalSeparator || ".";
var thousand = params.thousandSeparator || ",";
var emptyAlign = 0;
a = parseFloat(String(a).split(thousand).join("").split(decimal).join("."));
b = parseFloat(String(b).split(thousand).join("").split(decimal).join("."));
//handle non numeric values
if (isNaN(a)) {
emptyAlign = isNaN(b) ? 0 : -1;
} else if (isNaN(b)) {
emptyAlign = 1;
} else {
//compare valid values
return a - b;
}
//fix empty values in position
if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") {
emptyAlign *= -1;
}
return emptyAlign;
},
//sort strings
string: function string(a, b, aRow, bRow, column, dir, params) {
var alignEmptyValues = params.alignEmptyValues;
var emptyAlign = 0;
var locale;
//handle empty values
if (!a) {
emptyAlign = !b ? 0 : -1;
} else if (!b) {
emptyAlign = 1;
} else {
//compare valid values
switch (_typeof(params.locale)) {
case "boolean":
if (params.locale) {
locale = this.table.modules.localize.getLocale();
}
break;
case "string":
locale = params.locale;
break;
}
return String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);
}
//fix empty values in position
if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") {
emptyAlign *= -1;
}
return emptyAlign;
},
//sort date
date: function date(a, b, aRow, bRow, column, dir, params) {
if (!params.format) {
params.format = "DD/MM/YYYY";
}
return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params);
},
//sort hh:mm formatted times
time: function time(a, b, aRow, bRow, column, dir, params) {
if (!params.format) {
params.format = "hh:mm";
}
return this.sorters.datetime.call(this, a, b, aRow, bRow, column, dir, params);
},
//sort datetime
datetime: function datetime(a, b, aRow, bRow, column, dir, params) {
var format = params.format || "DD/MM/YYYY hh:mm:ss",
alignEmptyValues = params.alignEmptyValues,
emptyAlign = 0;
if (typeof moment != "undefined") {
a = moment(a, format);
b = moment(b, format);
if (!a.isValid()) {
emptyAlign = !b.isValid() ? 0 : -1;
} else if (!b.isValid()) {
emptyAlign = 1;
} else {
//compare valid values
return a - b;
}
//fix empty values in position
if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") {
emptyAlign *= -1;
}
return emptyAlign;
} else {
console.error("Sort Error - 'datetime' sorter is dependant on moment.js");
}
},
//sort booleans
boolean: function boolean(a, b, aRow, bRow, column, dir, params) {
var el1 = a === true || a === "true" || a === "True" || a === 1 ? 1 : 0;
var el2 = b === true || b === "true" || b === "True" || b === 1 ? 1 : 0;
return el1 - el2;
},
//sort if element contains any data
array: function array(a, b, aRow, bRow, column, dir, params) {
var el1 = 0;
var el2 = 0;
var type = params.type || "length";
var alignEmptyValues = params.alignEmptyValues;
var emptyAlign = 0;
function calc(value) {
switch (type) {
case "length":
return value.length;
break;
case "sum":
return value.reduce(function (c, d) {
return c + d;
});
break;
case "max":
return Math.max.apply(null, value);
break;
case "min":
return Math.min.apply(null, value);
break;
case "avg":
return value.reduce(function (c, d) {
return c + d;
}) / value.length;
break;
}
}
//handle non array values
if (!Array.isArray(a)) {
alignEmptyValues = !Array.isArray(b) ? 0 : -1;
} else if (!Array.isArray(b)) {
alignEmptyValues = 1;
} else {
//compare valid values
el1 = a ? calc(a) : 0;
el2 = b ? calc(b) : 0;
return el1 - el2;
}
//fix empty values in position
if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") {
emptyAlign *= -1;
}
return emptyAlign;
},
//sort if element contains any data
exists: function exists(a, b, aRow, bRow, column, dir, params) {
var el1 = typeof a == "undefined" ? 0 : 1;
var el2 = typeof b == "undefined" ? 0 : 1;
return el1 - el2;
},
//sort alpha numeric strings
alphanum: function alphanum(as, bs, aRow, bRow, column, dir, params) {
var a,
b,
a1,
b1,
i = 0,
L,
rx = /(\d+)|(\D+)/g,
rd = /\d/;
var alignEmptyValues = params.alignEmptyValues;
var emptyAlign = 0;
//handle empty values
if (!as && as !== 0) {
emptyAlign = !bs && bs !== 0 ? 0 : -1;
} else if (!bs && bs !== 0) {
emptyAlign = 1;
} else {
if (isFinite(as) && isFinite(bs)) return as - bs;
a = String(as).toLowerCase();
b = String(bs).toLowerCase();
if (a === b) return 0;
if (!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;
a = a.match(rx);
b = b.match(rx);
L = a.length > b.length ? b.length : a.length;
while (i < L) {
a1 = a[i];
b1 = b[i++];
if (a1 !== b1) {
if (isFinite(a1) && isFinite(b1)) {
if (a1.charAt(0) === "0") a1 = "." + a1;
if (b1.charAt(0) === "0") b1 = "." + b1;
return a1 - b1;
} else return a1 > b1 ? 1 : -1;
}
}
return a.length > b.length;
}
//fix empty values in position
if (alignEmptyValues === "top" && dir === "desc" || alignEmptyValues === "bottom" && dir === "asc") {
emptyAlign *= -1;
}
return emptyAlign;
}
};
Tabulator.prototype.registerModule("sort", Sort);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sort=function(t){this.table=t,this.sortList=[],this.changed=!1};Sort.prototype.initializeColumn=function(t,e){var r,o,n=this,i=!1;switch(_typeof(t.definition.sorter)){case"string":n.sorters[t.definition.sorter]?i=n.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":i=t.definition.sorter}t.modules.sort={sorter:i,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:void 0!==t.definition.headerSortTristate?t.definition.headerSortTristate:this.table.options.headerSortTristate},(void 0===t.definition.headerSort?!1!==this.table.options.headerSort:!1!==t.definition.headerSort)&&(r=t.getElement(),r.classList.add("tabulator-sortable"),o=document.createElement("div"),o.classList.add("tabulator-arrow"),e.appendChild(o),r.addEventListener("click",function(e){var r="",o=[],i=!1;if(t.modules.sort){if(t.modules.sort.tristate)r="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":r="desc";break;case"desc":r="asc";break;default:r=t.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?(o=n.getSort(),i=o.findIndex(function(e){return e.field===t.getField()}),i>-1?(o[i].dir=r,i!=o.length-1&&(i=o.splice(i,1)[0],"none"!=r&&o.push(i))):"none"!=r&&o.push({column:t,dir:r}),n.setSort(o)):"none"==r?n.clear():n.setSort(t,r),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},Sort.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},Sort.prototype.getSort=function(){var t=this,e=[];return t.sortList.forEach(function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}),e},Sort.prototype.setSort=function(t,e){var r=this,o=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;e=r.table.columnManager.findColumn(t.column),e?(t.column=e,o.push(t),r.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),r.sortList=o,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},Sort.prototype.clear=function(){this.setSort([])},Sort.prototype.findSorter=function(t){var e,r=this.table.rowManager.activeRows[0],o="string";if(r&&(r=r.getData(),t.getField()))switch(e=t.getFieldValue(r),void 0===e?"undefined":_typeof(e)){case"undefined":o="string";break;case"boolean":o="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(o="alphanum"):o="number"}return this.sorters[o]},Sort.prototype.sort=function(t){var e=this,r=this.table.options.sortOrderReverse?e.sortList.slice().reverse():e.sortList,o=[];e.table.options.dataSorting&&e.table.options.dataSorting.call(e.table,e.getSort()),e.clearColumnHeaders(),e.table.options.ajaxSorting?r.forEach(function(t,r){e.setColumnHeader(t.column,t.dir)}):(r.forEach(function(t,r){var n=t.column.modules.sort;t.column&&n&&(n.sorter||(n.sorter=e.findSorter(t.column)),t.params="function"==typeof n.params?n.params(t.column.getComponent(),t.dir):n.params,o.push(t)),e.setColumnHeader(t.column,t.dir)}),o.length&&e._sortItems(t,o)),e.table.options.dataSorted&&e.table.options.dataSorted.call(e.table,e.getSort(),e.table.rowManager.getComponents("active"))},Sort.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})},Sort.prototype.setColumnHeader=function(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort",e)},Sort.prototype._sortItems=function(t,e){var r=this,o=e.length-1;t.sort(function(t,n){for(var i,s=o;s>=0;s--){var a=e[s];if(0!==(i=r._sortRow(t,n,a.column,a.dir,a.params)))break}return i})},Sort.prototype._sortRow=function(t,e,r,o,n){var i,s,a="asc"==o?t:e,l="asc"==o?e:t;return t=r.getFieldValue(a.getData()),e=r.getFieldValue(l.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",i=a.getComponent(),s=l.getComponent(),r.modules.sort.sorter.call(this,t,e,i,s,r.getComponent(),o,n)},Sort.prototype.sorters={number:function(t,e,r,o,n,i,s){var a=s.alignEmptyValues,l=s.decimalSeparator||".",u=s.thousandSeparator||",",c=0;if(t=parseFloat(String(t).split(u).join("").split(l).join(".")),e=parseFloat(String(e).split(u).join("").split(l).join(".")),isNaN(t))c=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;c=1}return("top"===a&&"desc"===i||"bottom"===a&&"asc"===i)&&(c*=-1),c},string:function(t,e,r,o,n,i,s){var a,l=s.alignEmptyValues,u=0;if(t){if(e){switch(_typeof(s.locale)){case"boolean":s.locale&&(a=this.table.modules.localize.gLine truncated
@@ -0,0 +1,217 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var Validate = function Validate(table) {
this.table = table;
};
//validate
Validate.prototype.initializeColumn = function (column) {
var self = this,
config = [],
validator;
if (column.definition.validator) {
if (Array.isArray(column.definition.validator)) {
column.definition.validator.forEach(function (item) {
validator = self._extractValidator(item);
if (validator) {
config.push(validator);
}
});
} else {
validator = this._extractValidator(column.definition.validator);
if (validator) {
config.push(validator);
}
}
column.modules.validate = config.length ? config : false;
}
};
Validate.prototype._extractValidator = function (value) {
var type, params, pos;
switch (typeof value === "undefined" ? "undefined" : _typeof(value)) {
case "string":
pos = value.indexOf(':');
if (pos > -1) {
type = value.substring(0, pos);
params = value.substring(pos + 1);
} else {
type = value;
}
return this._buildValidator(type, params);
break;
case "function":
return this._buildValidator(value);
break;
case "object":
return this._buildValidator(value.type, value.parameters);
break;
}
};
Validate.prototype._buildValidator = function (type, params) {
var func = typeof type == "function" ? type : this.validators[type];
if (!func) {
console.warn("Validator Setup Error - No matching validator found:", type);
return false;
} else {
return {
type: typeof type == "function" ? "function" : type,
func: func,
params: params
};
}
};
Validate.prototype.validate = function (validators, cell, value) {
var self = this,
valid = [];
if (validators) {
validators.forEach(function (item) {
if (!item.func.call(self, cell, value, item.params)) {
valid.push({
type: item.type,
parameters: item.params
});
}
});
}
return valid.length ? valid : true;
};
Validate.prototype.validators = {
//is integer
integer: function integer(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
value = Number(value);
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
},
//is float
float: function float(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
value = Number(value);
return typeof value === 'number' && isFinite(value) && value % 1 !== 0;
},
//must be a number
numeric: function numeric(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
return !isNaN(value);
},
//must be a string
string: function string(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
return isNaN(value);
},
//maximum value
max: function max(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
return parseFloat(value) <= parameters;
},
//minimum value
min: function min(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
return parseFloat(value) >= parameters;
},
//minimum string length
minLength: function minLength(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
return String(value).length >= parameters;
},
//maximum string length
maxLength: function maxLength(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
return String(value).length <= parameters;
},
//in provided value list
in: function _in(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
if (typeof parameters == "string") {
parameters = parameters.split("|");
}
return value === "" || parameters.indexOf(value) > -1;
},
//must match provided regex
regex: function regex(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
var reg = new RegExp(parameters);
return reg.test(value);
},
//value must be unique in this column
unique: function unique(cell, value, parameters) {
if (value === "" || value === null || typeof value === "undefined") {
return true;
}
var unique = true;
var cellData = cell.getData();
var column = cell.getColumn()._getSelf();
this.table.rowManager.rows.forEach(function (row) {
var data = row.getData();
if (data !== cellData) {
if (value == column.getFieldValue(data)) {
unique = false;
}
}
});
return unique;
},
//must have a value
required: function required(cell, value, parameters) {
return value !== "" && value !== null && typeof value !== "undefined";
}
};
Tabulator.prototype.registerModule("validate", Validate);
+2
View File
@@ -0,0 +1,2 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Validate=function(t){this.table=t};Validate.prototype.initializeColumn=function(t){var n,i=this,r=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(t){(n=i._extractValidator(t))&&r.push(n)}):(n=this._extractValidator(t.definition.validator))&&r.push(n),t.modules.validate=!!r.length&&r)},Validate.prototype._extractValidator=function(t){var n,i,r;switch(void 0===t?"undefined":_typeof(t)){case"string":return r=t.indexOf(":"),r>-1?(n=t.substring(0,r),i=t.substring(r+1)):n=t,this._buildValidator(n,i);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}},Validate.prototype._buildValidator=function(t,n){var i="function"==typeof t?t:this.validators[t];return i?{type:"function"==typeof t?"function":t,func:i,params:n}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)},Validate.prototype.validate=function(t,n,i){var r=this,o=[];return t&&t.forEach(function(t){t.func.call(r,n,i,t.params)||o.push({type:t.type,parameters:t.params})}),!o.length||o},Validate.prototype.validators={integer:function(t,n,i){return""===n||null===n||void 0===n||"number"==typeof(n=Number(n))&&isFinite(n)&&Math.floor(n)===n},float:function(t,n,i){return""===n||null===n||void 0===n||"number"==typeof(n=Number(n))&&isFinite(n)&&n%1!=0},numeric:function(t,n,i){return""===n||null===n||void 0===n||!isNaN(n)},string:function(t,n,i){return""===n||null===n||void 0===n||isNaN(n)},max:function(t,n,i){return""===n||null===n||void 0===n||parseFloat(n)<=i},min:function(t,n,i){return""===n||null===n||void 0===n||parseFloat(n)>=i},minLength:function(t,n,i){return""===n||null===n||void 0===n||String(n).length>=i},maxLength:function(t,n,i){return""===n||null===n||void 0===n||String(n).length<=i},in:function(t,n,i){return""===n||null===n||void 0===n||("string"==typeof i&&(i=i.split("|")),""===n||i.indexOf(n)>-1)},regex:function(t,n,i){return""===n||null===n||void 0===n||new RegExp(i).test(n)},unique:function(t,n,i){if(""===n||null===n||void 0===n)return!0;var r=!0,o=t.getData(),e=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var i=t.getData();i!==o&&n==e.getFieldValue(i)&&(r=!1)}),r},required:function(t,n,i){return""!==n&&null!==n&&void 0!==n}},Tabulator.prototype.registerModule("validate",Validate);
File diff suppressed because it is too large. Load diff
+13
View File
@@ -0,0 +1,13 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
var _typeof="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};!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Tabulator=t()}(this,function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<o;){var s=t[n];if(e.call(i,s,n,t))return n;n++}return-1}}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<o;){var s=t[n];if(e.call(i,s,n,t))return s;n++}}});var t=function(e){this.table=e,this.blockHozScrollEvent=!1,this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.rowManager=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.element.insertBefore(this.headersElement,this.element.firstChild)};t.prototype.createHeadersElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e},t.prototype.createHeaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-header"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e},t.prototype.initialize=function(){},t.prototype.setRowManager=function(e){this.rowManager=e},t.prototype.getElement=function(){return this.element},t.prototype.getHeadersElement=function(){return this.headersElement},t.prototype.scrollHorizontal=function(e){var t=0,o=this.element.scrollWidth-this.table.element.clientWidth;this.element.scrollLeft=e,e>o?(t=e-o,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},t.prototype.generateColumnsFromRowData=function(e){var t,o,i=[];if(e&&e.length){t=e[0];for(var n in t){var s={field:n,title:n},r=t[n];switch(void 0===r?"undefined":_typeof(r)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(r)?"array":"string";break;default:o=isNaN(r)||""===r?r.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(e,t){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),e.forEach(function(e,t){o._addColumn(e)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},t.prototype._addColumn=function(e,t,o){var n=new i(e,this),s=n.getElement(),r=o?this.findColumnIndex(o):o;if(o&&r>-1){var a=this.columns.indexOf(o.getTopColumn()),l=o.getElement();t?(this.columns.splice(a,0,n),l.parentNode.insertBefore(s,l)):(this.columns.splice(a+1,0,n),l.parentNode.insertBefore(s,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())),n.columnRendered();return n},t.prototype.registerColumnField=function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)},t.prototype.registerColumnPosition=function(e){this.columnsByIndex.push(e)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(e){e.reRegisterPosition()})},t.prototype._verticalAlignHeaders=function(){var e=this,t=0;e.columns.forEach(function(e){var o;e.clearVerticalAlign(),(o=e.getHeight())>t&&(t=o)}),e.columns.forEach(function(o){o.verticalAlign(e.table.options.columnHeaderVertAlign,t)}),e.rowManager.adjustTableSize()},t.prototype.findColumn=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e)))return this.columnsByField[e]||!1;if(e instanceof i)return e;if(e instanceof o)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.columns.find(function(t){return t.element===e})||!1}return!1},t.prototype.getColumnByField=function(e){return this.columnsByField[e]},t.prototype.getColumnsByFieldRoot=function(e){var t=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===e&&o.push(t.columnsByField[i])}),o},t.prototype.getColumnLine truncated
i.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams"],i.prototype.getComponent=function(){return new o(this)};var n=function(e){this.table=e,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,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=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};n.prototype.createHolderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-tableHolder"),e.setAttribute("tabindex",0),e},n.prototype.createTableElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e},n.prototype.getElement=function(){return this.element},n.prototype.getTableElement=function(){return this.tableElement},n.prototype.getRowPosition=function(e,t){return t?this.activeRows.indexOf(e):this.rows.indexOf(e)},n.prototype.setColumnManager=function(e){this.columnManager=e},n.prototype.initialize=function(){var e=this;e.setRenderMode(),e.element.appendChild(e.tableElement),e.firstRender=!0,e.element.addEventListener("scroll",function(){var t=e.element.scrollLeft;e.scrollLeft!=t&&(e.columnManager.scrollHorizontal(t),e.table.options.groupBy&&e.table.modules.groupRows.scrollHeaders(t),e.table.modExists("columnCalcs")&&e.table.modules.columnCalcs.scrollHorizontal(t),e.table.options.scrollHorizontal(t)),e.scrollLeft=t}),"virtual"===this.renderMode&&e.element.addEventListener("scroll",function(){var t=e.element.scrollTop,o=e.scrollTop>t;e.scrollTop!=t?(e.scrollTop=t,e.scrollVertical(o),"scroll"==e.table.options.ajaxProgressiveLoad&&e.table.modules.ajax.nextPage(e.element.scrollHeight-e.element.clientHeight-t),e.table.options.scrollVertical(t)):e.scrollTop=t})},n.prototype.findRow=function(e){var t=this;if("object"!=(void 0===e?"undefined":_typeof(e))){if(void 0===e||null===e)return!1;return t.rows.find(function(o){return o.data[t.table.options.index]==e})||!1}if(e instanceof r)return e;if(e instanceof s)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t.rows.find(function(t){return t.element===e})||!1}return!1},n.prototype.getRowFromDataObject=function(e){return this.rows.find(function(t){return t.data===e})||!1},n.prototype.getRowFromPosition=function(e,t){return t?this.activeRows[e]:this.rows[e]},n.prototype.scrollToRow=function(e,t,o){var i,n=this,s=this.getDisplayRows().indexOf(e),r=e.getElement(),a=0;return new Promise(function(e,l){if(s>-1){if(void 0===t&&(t=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===t)switch(n.renderMode){case"classic":i=u.prototype.helpers.elOffset(r).top,t=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";breLine truncated
return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},s.prototype.reformat=function(){return this._row.reinitialize()},s.prototype.getGroup=function(){return this._row.getGroup().getComponent()},s.prototype.getTable=function(){return this._row.table},s.prototype.getNextRow=function(){var e=this._row.nextRow();return e?e.getComponent():e},s.prototype.getPrevRow=function(){var e=this._row.prevRow();return e?e.getComponent():e};var r=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=t.table,this.parent=t,this.data={},this.type=o,this.element=this.createElement(),this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.setData(e),this.generateElement()};r.prototype.createElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.setAttribute("role","row"),e},r.prototype.getElement=function(){return this.element},r.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},r.prototype.generateElement=function(){var e,t,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),i.table.options.rowContextMenu&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(e){i.table.options.rowClick(e,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(e){i.table.options.rowDblClick(e,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(e){i.table.options.rowContext(e,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(e){i.table.options.rowMouseEnter(e,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(e){i.table.options.rowMouseLeave(e,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(e){i.table.options.rowMouseOver(e,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(e){i.table.options.rowMouseOut(e,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(e){i.table.options.rowMouseMove(e,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(e){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(e){o&&i.table.options.rowTap(e,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(e=null,i.element.addEventListener("touchend",function(t){e?(clearTimeout(e),e=null,i.table.options.rowDblTap(t,i.getComponent())):e=setTimeout(function(){clearTimeout(e),e=null},300)})),i.table.options.rowTapHold&&(t=null,i.element.addEventListener("touchstart",function(e){clearTimeout(t),t=setTimeout(function(){clearTimeout(t),t=null,o=!1,i.table.options.rowTapHold(e,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(e){clearTimeout(t),t=null}))},r.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},r.prototype.initialize=function(e){var t=this;if(!t.initialized||e){for(t.deleteCells();t.element.firstChild;)t.element.removeChild(t.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),t.cells.forEach(function(e){t.element.appendChild(e.getElement()),e.cellRendered()}),e&&t.normalizeHeight(),t.table.options.dataTree&&t.table.modExists("dataTree")&&t.table.modules.dataTree.layoutRow(this),"collapse"===t.table.options.responsiveLayout&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.layoutRow(this),t.table.options.rowFormatter&&t.table.options.rowFormatter(t.getComponent()),t.table.options.resizableRows&&t.table.modExists("resizeRows")&&t.table.modules.resizeRows.initializeRow(t),t.initialized=!0}},r.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},r.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},r.prototype.calcHeight=function(e){var t=0,o=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(e){var o=e.getHeight();o>t&&(t=o)}),this.height=e?Math.max(t,o):this.manLine truncated
u.prototype._buildElement=function(){var e=this,t=this.element,o=this.modules,i=this.options;for(i.tableBuilding.call(this),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),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modExists("layout",!0)&&o.layout.initialize(i.layout),!1!==i.headerFilterPlaceholder&&o.localize.setHeaderFilterPlaceholder(i.headerFilterPlaceholder);for(var n in i.langs)o.localize.installLang(n,i.langs[n]);if(o.localize.setLocale(i.locale),"string"==typeof i.placeholder){var s=document.createElement("div");s.classList.add("tabulator-placeholder");var r=document.createElement("span");r.innerHTML=i.placeholder,s.appendChild(r),i.placeholder=s}if(t.appendChild(this.columnManager.getElement()),t.appendChild(this.rowManager.getElement()),i.footerElement&&this.footerManager.activate(),i.persistence&&this.modExists("persistence",!0)&&o.persistence.initialize(),i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.columns&&(i.columns=o.persistence.load("columns",i.columns)),i.movableRows&&this.modExists("moveRow")&&o.moveRow.initialize(),i.autoColumns&&this.options.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modExists("columnCalcs")&&o.columnCalcs.initialize(),this.columnManager.setColumns(i.columns),i.dataTree&&this.modExists("dataTree",!0)&&o.dataTree.initialize(),this.modExists("frozenRows")&&this.modules.frozenRows.initialize(),(i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.sort||i.initialSort)&&this.modExists("sort",!0)){var a=[];i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.sort?!1===(a=o.persistence.load("sort"))&&i.initialSort&&(a=i.initialSort):i.initialSort&&(a=i.initialSort),o.sort.setSort(a)}if((i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.filter||i.initialFilter)&&this.modExists("filter",!0)){var l=[];i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.filter?!1===(l=o.persistence.load("filter"))&&i.initialFilter&&(l=i.initialFilter):i.initialFilter&&(l=i.initialFilter),o.filter.setFilter(l)}i.initialHeaderFilter&&this.modExists("filter",!0)&&i.initialHeaderFilter.forEach(function(t){var i=e.columnManager.findColumn(t.field);if(!i)return console.warn("Column Filter Error - No matching column found:",t.field),!1;o.filter.setHeaderFilterValue(i,t.value)}),this.modExists("ajax")&&o.ajax.initialize(),i.pagination&&this.modExists("page",!0)&&o.page.initialize(),i.groupBy&&this.modExists("groupRows",!0)&&o.groupRows.initialize(),this.modExists("keybindings")&&o.keybindings.initialize(),this.modExists("selectRow")&&o.selectRow.clearSelectionData(!0),i.autoResize&&this.modExists("resizeTable")&&o.resizeTable.initialize(),this.modExists("clipboard")&&o.clipboard.initialize(),i.printAsHtml&&this.modExists("print")&&o.print.initialize(),i.tableBuilt.call(this)},u.prototype._loadInitialData=function(){var e=this;if(e.options.pagination&&e.modExists("page"))if(e.modules.page.reset(!0,!0),"local"==e.options.pagination){if(e.options.data.length)e.rowManager.setData(e.options.data,!1,!0);else{if((e.options.ajaxURL||e.options.ajaxURLGenerator)&&e.modExists("ajax"))return void e.modules.ajax.loadData(!1,!0).then(function(){}).catch(function(){e.options.paginationInitialPage&&e.modules.page.setPage(e.options.paginationInitialPage)});e.rowManager.setData(e.options.data,!1,!0)}e.options.paginationInitialPage&&e.modules.page.setPage(e.options.paginationInitialPage)}else e.options.ajaxURL?e.modules.page.setPage(e.options.paginationInitialPage).then(function(){}).catch(function(){}):e.rowManager.setData([],!1,!0);else e.options.data.length?e.rowManager.setData(e.options.data):(e.options.ajaxURL||e.options.ajaxURLGenerator)&&e.modExists("ajax")?e.modules.ajax.loadData(!1,!0).then(function(){}).catch(function(){}):e.rowManager.setData(e.options.data,!1,!0)},u.prototype.destroy=function(){var e=this.element;for(u.prototype.comms.deregister(this),this.options.reactiveData&&this.modExists("reactiveData",!0)&&this.modules.reactiveData.unwatchData(),this.rowManager.rows.forEach(function(e){e.wipe()}),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[],this.options.autoResize&&this.modExists("resizeTable")&&this.modules.resizeTable.clearBindings(),this.modExists("keybindings")&&this.modules.keybindings.clearBindings();e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator")},u.prototype._detectBrowser=function(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexLine truncated
this.bindings[e] || (this.bindings[e] = []), this.bindings[e].push(t), t(this.getText(e), this.lang)
}, h.prototype._executeBindings = function () { var e = this; for (var t in e.bindings) !function (t) { e.bindings[t].forEach(function (o) { o(e.getText(t), e.lang) }) }(t) }, h.prototype.langs = { default: { groups: { item: "item", items: "items" }, columns: {}, ajax: { loading: "Loading", error: "Error" }, pagination: { page_size: "Page Size", first: "First", first_title: "First Page", last: "Last", last_title: "Last Page", prev: "Prev", prev_title: "Prev Page", next: "Next", next_title: "Next Page" }, headerFilters: { default: "filter column...", columns: {} } } }, u.prototype.registerModule("localize", h); var p = function (e) { this.table = e }; p.prototype.getConnections = function (e) { var t, o = this, i = []; return t = u.prototype.comms.lookupTable(e), t.forEach(function (e) { o.table !== e && i.push(e) }), i }, p.prototype.send = function (e, t, o, i) { var n = this, s = this.getConnections(e); s.forEach(function (e) { e.tableComms(n.table.element, t, o, i) }), !s.length && e && console.warn("Table Connection Error - No tables matching selector found", e) }, p.prototype.receive = function (e, t, o, i) { if (this.table.modExists(t)) return this.table.modules[t].commsReceived(e, o, i); console.warn("Inter-table Comms Error - no such module:", t) }, u.prototype.registerModule("comms", p); var m = function (e) { this.table = e, this.allowedTypes = ["", "data", "download", "clipboard", "print", "htmlOutput"] }; m.prototype.initializeColumn = function (e) { var t = this, o = !1, i = {}; this.allowedTypes.forEach(function (n) { var s, r = "accessor" + (n.charAt(0).toUpperCase() + n.slice(1)); e.definition[r] && (s = t.lookupAccessor(e.definition[r])) && (o = !0, i[r] = { accessor: s, params: e.definition[r + "Params"] || {} }) }), o && (e.modules.accessor = i) }, m.prototype.lookupAccessor = function (e) { var t = !1; switch (void 0 === e ? "undefined" : _typeof(e)) { case "string": this.accessors[e] ? t = this.accessors[e] : console.warn("Accessor Error - No such accessor found, ignoring: ", e); break; case "function": t = e }return t }, m.prototype.transformRow = function (e, t) { var o = this, i = "accessor" + (t.charAt(0).toUpperCase() + t.slice(1)), n = u.prototype.helpers.deepClone(e || {}); return o.table.columnManager.traverse(function (e) { var o, s, r, a; e.modules.accessor && (s = e.modules.accessor[i] || e.modules.accessor.accessor || !1) && "undefined" != (o = e.getFieldValue(n)) && (a = e.getComponent(), r = "function" == typeof s.params ? s.params(o, n, t, a) : s.params, e.setFieldValue(n, s.accessor(o, n, t, r, a))) }), n }, m.prototype.accessors = {}, u.prototype.registerModule("accessor", m); var f = function (e) { this.table = e, this.config = !1, this.url = "", this.urlGenerator = !1, this.params = !1, this.loaderElement = this.createLoaderElement(), this.msgElement = this.createMsgElement(), this.loadingElement = !1, this.errorElement = !1, this.loaderPromise = !1, this.progressiveLoad = !1, this.loading = !1, this.requestOrder = 0 }; f.prototype.initialize = function () { var e; this.loaderElement.appendChild(this.msgElement), this.table.options.ajaxLoaderLoading && ("string" == typeof this.table.options.ajaxLoaderLoading ? (e = document.createElement("template"), e.innerHTML = this.table.options.ajaxLoaderLoading.trim(), this.loadingElement = e.content.firstChild) : this.loadingElement = this.table.options.ajaxLoaderLoading), this.loaderPromise = this.table.options.ajaxRequestFunc || this.defaultLoaderPromise, this.urlGenerator = this.table.options.ajaxURLGenerator || this.defaultURLGenerator, this.table.options.ajaxLoaderError && ("string" == typeof this.table.options.ajaxLoaderError ? (e = document.createElement("template"), e.innerHTML = this.table.options.ajaxLoaderError.trim(), this.errorElement = e.content.firstChild) : this.errorElement = this.table.options.ajaxLoaderError), this.table.options.ajaxParams && this.setParams(this.table.options.ajaxParams), this.table.options.ajaxConfig && this.setConfig(this.table.options.ajaxConfig), this.table.options.ajaxURL && this.setUrl(this.table.options.ajaxURL), this.table.options.ajaxProgressiveLoad && (this.table.options.pagination ? (this.progressiveLoad = !1, console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")) : this.table.modExists("page") ? (this.progressiveLoad = this.table.options.ajaxProgressiveLoad, this.table.modules.page.initializeProgressive(this.progressiveLoad)) : console.error("Pagination plugin is required for progressive ajax loading")) }, f.prototype.createLoaderElement = function () { var e = document.createElement("div"); return e.classList.add("tabulator-loader"), e }, f.prototype.createMsgElement = function () { var e = document.createElement("div"); return e.classList.add("tabulator-loader-msg"), e.setAttribute("role", "alert"), e }, f.prototype.setParams = function (e, t) { if (t) { this.params = this.params || {}; for (var o in e) this.params[o] = e[Line truncated
if("row"==e.type){var t=e.getGroup();-1===n.indexOf(t)&&n.push(t)}})):n=this.table.modules.groupRows.getGroups(),n.forEach(function(e){i.push(t.processGroupData(e,s))})):(this.config.dataTree&&(e=e="display"),i=o.table.rowManager.getData(e,"download")),this.config.columnCalcs&&(r=this.table.getCalcResults(),i={calcs:r,data:i}),"function"==typeof o.table.options.downloadDataFormatter&&(i=o.table.options.downloadDataFormatter(i)),i},y.prototype.processGroupData=function(e,t){var o=this,i=e.getSubGroups(),n={type:"group",key:e.key};return i.length?(n.subGroups=[],i.forEach(function(e){n.subGroups.push(o.processGroupData(e,t))})):t?(n.rows=[],e.rows.forEach(function(e){t.indexOf(e)>-1&&n.rows.push(e.getData("download"))})):n.rows=e.getData(!0,"download"),n},y.prototype.triggerDownload=function(e,t,o,i,n){var s=document.createElement("a"),r=new Blob([e],{type:t}),i=i||"Tabulator."+("function"==typeof o?"txt":o);(r=this.table.options.downloadReady.call(this.table,e,r))&&(n?window.open(window.URL.createObjectURL(r)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,i):(s.setAttribute("href",window.URL.createObjectURL(r)),s.setAttribute("download",i),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},y.prototype.getFieldValue=function(e,t){var o=this.columnsByField[e];return!!o&&o.getFieldValue(t)},y.prototype.commsReceived=function(e,t,o){switch(t){case"intercept":this.download(o.type,"",o.options,o.active,o.intercept)}},y.prototype.downloaders={csv:function(e,t,o,i,n){function s(e,t){e.subGroups?e.subGroups.forEach(function(e){s(e,t+1)}):(d.push('"'+String(e.title).split('"').join('""')+'"'),h.push(e.definition.field))}function r(e){e.forEach(function(e){var t=[];h.forEach(function(o){var i=u.getFieldValue(o,e);switch(void 0===i?"undefined":_typeof(i)){case"object":i=JSON.stringify(i);break;case"undefined":case"null":i="";break;default:i=i}t.push('"'+String(i).split('"').join('""')+'"')}),l.push(t.join(p))})}function a(e){e.subGroups?e.subGroups.forEach(function(e){a(e)}):r(e.rows)}var l,c,u=this,d=[],h=[],p=o&&o.delimiter?o.delimiter:",";n.columnGroups?(console.warn("Download Warning - CSV downloader cannot process column groups"),e.forEach(function(e){s(e,0)})):function(){e.forEach(function(e){d.push('"'+String(e.title).split('"').join('""')+'"'),h.push(e.field)})}(),l=[d.join(p)],n.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),t=t.data),n.rowGroups?(console.warn("Download Warning - CSV downloader cannot process row groups"),t.forEach(function(e){a(e)})):r(t),c=l.join("\n"),o.bom&&(c="\ufeff"+c),i(c,"text/csv")},json:function(e,t,o,i,n){var s;n.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),t=t.data),s=JSON.stringify(t,null,"\t"),i(s,"application/json")},pdf:function(e,t,o,i,n){function s(e,t){var o=e.width,i=1,n={content:e.title||""};if(e.subGroups?(e.subGroups.forEach(function(e){s(e,t+1)}),i=1):(h.push(e.definition.field),i=g-t),n.rowSpan=i,p[t].push(n),o--,i>1)for(var r=t+1;r<g;r++)p[r].push("");for(var r=0;r<o;r++)p[t].push("")}function r(e){switch(void 0===e?"undefined":_typeof(e)){case"object":e=JSON.stringify(e);break;case"undefined":case"null":e="";break;default:e=e}return e}function a(e){e.forEach(function(e){m.push(l(e))})}function l(e,t){var o=[];return h.forEach(function(i){var n=d.getFieldValue(i,e);n=r(n),t?o.push({content:n,styles:t}):o.push(n)}),o}function c(e,t){var o=[];o.push({content:r(e.key),colSpan:h.length,styles:v}),m.push(o),e.subGroups?e.subGroups.forEach(function(o){c(o,t[e.key]?t[e.key].groups||{}:{})}):(n.columnCalcs&&u(t,e.key,"top"),a(e.rows),n.columnCalcs&&u(t,e.key,"bottom"))}function u(e,t,o){var i=e[t];i&&(o&&(i=i[o]),Object.keys(i).length&&m.push(l(i,y)))}var d=this,h=[],p=[],m=[],f={},g=1,b={},v=o.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},y=o.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},w=o.jsPDF||{},E=o&&o.title?o.title:"";if(n.columnCalcs&&(f=t.calcs,t=t.data),w.orientation||(w.orientation=o.orientation||"landscape"),w.unit||(w.unit="pt"),n.columnGroups){e.forEach(function(e){e.depth>g&&(g=e.depth)});for(var C=0;C<g;C++)p.push([]);e.forEach(function(e){s(e,0)})}else!function(){e.forEach(function(e){e.field&&(p.push(e.title||""),h.push(e.field))}),p=[p]}();n.rowGroups?t.forEach(function(e){c(e,f)}):(n.columnCalcs&&u(f,"top"),a(t),n.columnCalcs&&u(f,"bottom"));var x=new jsPDF(w);o&&o.autoTable&&(b="function"==typeof o.autoTable?o.autoTable(x)||{}:o.autoTable),E&&(b.addPageContent=function(e){x.text(E,40,30)}),b.head=p,b.body=m,x.autoTable(b),o&&o.documentProcessing&&o.documentProcessing(x),i(x.output("arraybuffer"),"application/pdf")},xlsx:function(e,t,o,i,n){function s(){function o(e,t){void 0===f[t]&&(f[t]=[]),void 0===h[t]&&(h[t]=[]),e.width>1&&h[t].push({type:"hoz",start:f[t].length,Line truncated
13==e.keyCode&&o(s()),27==e.keyCode&&i()}),a}},u.prototype.registerModule("edit",w);var E=function(e){this.table=e,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};E.prototype.genereateTable=function(e,t,o,i){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=i;var n=document.createElement("table");return n.classList.add("tabulator-print-table"),!1!==this.config.columnHeaders&&n.appendChild(this.generateHeaderElements()),n.appendChild(this.generateBodyElements(this.rowLookup(o))),this.mapElementStyles(this.table.element,n,["border-top","border-left","border-right","border-bottom"]),n},E.prototype.rowLookup=function(e){var t=this,o=[];if("function"==typeof e)e.call(this.table).forEach(function(e){(e=t.table.rowManager.findRow(e))&&o.push(e)});else switch(e){case!0:case"visible":o=this.table.rowManager.getVisibleRows(!0);break;case"all":o=this.table.rowManager.rows;break;case"selected":o=this.table.modules.selectRow.selectedRows;break;case"active":default:o=this.table.rowManager.getDisplayRows()}return Object.assign([],o)},E.prototype.generateColumnGroupHeaders=function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach(function(o){var i=e.processColumnGroup(o);i&&t.push(i)}),t},E.prototype.processColumnGroup=function(e){var t=this,o=e.columns,i=0,n={title:e.definition.title,column:e,depth:1};if(o.length){if(n.subGroups=[],n.width=0,o.forEach(function(e){var o=t.processColumnGroup(e);o&&(n.width+=o.width,n.subGroups.push(o),o.depth>i&&(i=o.depth))}),n.depth+=i,!n.width)return!1}else{if(!this.columnVisCheck(e))return!1;n.width=1}return n},E.prototype.groupHeadersToRows=function(e){function t(e,n){var s=i-n;void 0===o[n]&&(o[n]=[]),e.height=e.subGroups?1:s-e.depth+1,o[n].push(e),e.subGroups&&e.subGroups.forEach(function(e){t(e,n+1)})}var o=[],i=0;return e.forEach(function(e){e.depth>i&&(i=e.depth)}),e.forEach(function(e){t(e,0)}),o},E.prototype.generateHeaderElements=function(){var e=this,t=document.createElement("thead");return this.groupHeadersToRows(this.generateColumnGroupHeaders()).forEach(function(o){var i=document.createElement("tr");e.mapElementStyles(e.table.columnManager.getHeadersElement(),t,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),o.forEach(function(t){var o=document.createElement("th"),n=t.column.definition.cssClass?t.column.definition.cssClass.split(" "):[];o.colSpan=t.width,o.rowSpan=t.height,o.innerHTML=t.column.definition.title,e.cloneTableStyle&&(o.style.boxSizing="border-box"),n.forEach(function(e){o.classList.add(e)}),e.mapElementStyles(t.column.getElement(),o,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.mapElementStyles(t.column.contentElement,o,["padding-top","padding-left","padding-right","padding-bottom"]),t.column.visible?e.mapElementStyles(t.column.getElement(),o,["width"]):t.column.definition.width&&(o.style.width=t.column.definition.width+"px"),t.column.parent&&e.mapElementStyles(t.column.parent.groupElement,o,["border-top"]),i.appendChild(o)}),t.appendChild(i)}),t},E.prototype.generateBodyElements=function(e){},E.prototype.generateBodyElements=function(e){var t,o,i,n,s,r,a,l,c,u,d=this;u=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],u=null!==u?u:this.table.options.rowFormatter,this.cloneTableStyle&&window.getComputedStyle&&(t=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),o=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),i=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),n=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),r=this.table.element.getElementsByClassName("tabulator-group")[0],n&&(a=n.getElementsByClassName("tabulator-cell"),s=a[0],a[a.length-1]));var h=document.createElement("tbody"),p=[];return!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)),this.table.columnManager.columnsByIndex.forEach(function(e){d.columnVisCheck(e)&&p.push(e)}),this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(c=this.table.modules.dataTree.elementField),e=e.filter(function(e){switch(e.type){case"group":return!1!==d.config.rowGroups;case"calc":return!1!==d.config.columnCalcs}return!0}),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,n){var a=e.getData(d.colVisProp),m=document.createElement("tr");switch(m.classList.add("tabulator-print-table-row"),e.type){case"group":var f=docuLine truncated
t&&(s.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}var n=document.createElement("div"),s=e.getRow()._row.modules.responsiveLayout;return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="<span class='tabulator-responsive-collapse-toggle-open'>+</span><span class='tabulator-responsive-collapse-toggle-close'>-</span>",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",function(e){e.stopImmediatePropagation(),i(!s.open)}),i(s.open),n},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",function(e){e.stopPropagation()}),"function"==typeof e.getRow){var i=e.getRow();o.addEventListener("change",function(e){i.toggleSelect()}),o.checked=i.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(i,o)}else o.addEventListener("change",function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()}),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},u.prototype.registerModule("format",x);var R=function(e){this.table=e,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};R.prototype.reset=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},R.prototype.initializeColumn=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")},R.prototype.frozenCheck=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},R.prototype.scrollHorizontal=function(){var e,t=this;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){t.layout()},100),e=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),e.forEach(function(e){"row"===e.type&&t.layoutRow(e)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},R.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft},R.prototype.layoutCalcRows=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))},R.prototype.layoutColumnPosition=function(e){var t=this,o=[];this.leftColumns.forEach(function(i,n){if(i.modules.frozen.margin=t._calcSpace(t.leftColumns,n)+t.table.columnManager.scrollLeft+"px",n==t.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var s=t.getColGroupParentElement(i);o.includes(s)||(t.layoutElement(s,i),o.push(s)),i.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+i.modules.frozen.position)}else t.layoutElement(i.getElement(),i);e&&i.cells.forEach(function(e){t.layoutElement(e.getElement(),i)})}),this.rightColumns.forEach(function(o,i){o.modules.frozen.margin=t.rightPadding-t._calcSpace(t.rightColumns,i+1)+"px",i==t.rightColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup?t.layoutElement(t.getColGroupParentElement(o),o):t.layoutElement(o.getElement(),o),e&&o.cells.forEach(function(e){t.layoutElement(e.getElement(),o)})})},R.prototype.getColGroupParentElement=function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()},R.prototype.layout=function(){var e=this;e.active&&(this.calcMargins(),e.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&e.layoutRow(t)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)},R.prototype.layoutRow=function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(o){var i=e.getCell(o);i&&t.layoutElement(i.getElement(),o)}),this.rightColumns.forEach(function(o){var i=e.getCell(o);i&&t.layouLine truncated
;this.table.modExists("edit")&&(o=this.table.modules.edit.currentCell)&&(e.preventDefault(),t=o.nav(),t.next()||i&&(o.getElement().firstChild.blur(),i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(o.row.getComponent())):this.table.addRow(i),i.then(function(){setTimeout(function(){t.next()})})))},navLeft:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().left())},navRight:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().right())},navUp:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().up())},navDown:function(e){var t=!1;this.table.modExists("edit")&&(t=this.table.modules.edit.currentCell)&&(e.preventDefault(),t.nav().down())},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)}},u.prototype.registerModule("keybindings",z);var H=function(e){this.table=e,this.menuEl=!1,this.blurEvent=this.hideMenu.bind(this)};H.prototype.initializeColumnHeader=function(e){var t,o=this;e.definition.headerContextMenu&&e.getElement().addEventListener("contextmenu",function(t){var i="function"==typeof e.definition.headerContextMenu?e.definition.headerContextMenu(e.getComponent()):e.definition.headerContextMenu;t.preventDefault(),o.loadMenu(t,e,i)}),e.definition.headerMenu&&(t=document.createElement("span"),t.classList.add("tabulator-header-menu-button"),t.innerHTML="&vellip;",t.addEventListener("click",function(t){var i="function"==typeof e.definition.headerMenu?e.definition.headerMenu(e.getComponent()):e.definition.headerMenu;t.stopPropagation(),t.preventDefault(),o.loadMenu(t,e,i)}),e.titleElement.insertBefore(t,e.titleElement.firstChild))},H.prototype.initializeCell=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof e.column.definition.contextMenu?e.column.definition.contextMenu(e.getComponent()):e.column.definition.contextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},H.prototype.initializeRow=function(e){var t=this;e.getElement().addEventListener("contextmenu",function(o){var i="function"==typeof t.table.options.rowContextMenu?t.table.options.rowContextMenu(e.getComponent()):t.table.options.rowContextMenu;o.preventDefault(),t.loadMenu(o,e,i)})},H.prototype.loadMenu=function(e,t,o){var i=this,n=Math.max(document.body.offsetHeight,window.innerHeight);o&&o.length&&(this.hideMenu(),this.menuEl=document.createElement("div"),this.menuEl.classList.add("tabulator-menu"),o.forEach(function(e){var o=document.createElement("div"),n=e.label,s=e.disabled;e.separator?o.classList.add("tabulator-menu-separator"):(o.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n(t.getComponent())),n instanceof Node?o.appendChild(n):o.innerHTML=n,"function"==typeof s&&(s=s(t.getComponent())),s?(o.classList.add("tabulator-menu-item-disabled"),o.addEventListener("click",function(e){e.stopPropagation()})):o.addEventListener("click",function(o){i.hideMenu(),e.action(o,t.getComponent())})),i.menuEl.appendChild(o)}),this.menuEl.style.top=e.pageY+"px",this.menuEl.style.left=e.pageX+"px",document.body.addEventListener("click",this.blurEvent),this.table.rowManager.element.addEventListener("scroll",this.blurEvent),setTimeout(function(){document.body.addEventListener("contextmenu",i.blurEvent)},100),document.body.appendChild(this.menuEl),e.pageX+this.menuEl.offsetWidth>=document.body.offsetWidth&&(this.menuEl.style.left="",this.menuEl.style.right=document.body.offsetWidth-e.pageX+"px"),e.pageY+this.menuEl.offsetHeight>=n&&(this.menuEl.style.top="",this.menuEl.style.bottom=n-e.pageY+"px"))},H.prototype.hideMenu=function(){this.menuEl.parentNode&&this.menuEl.parentNode.removeChild(this.menuEl),this.blurEvent&&(document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent))},H.prototype.menus={},u.prototype.registerModule("menu",H);var F=function(e){this.table=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)};F.prototype.createPlaceholderElement=function(){vLine truncated
i.table.modules.ajax.setParams(e)})},_.prototype._parseRemoteData=function(e){var t,e,o,i=this;if(void 0===e[this.dataReceivedNames.last_page]&&console.warn("Remote Pagination Error - Server response missing '"+this.dataReceivedNames.last_page+"' property"),e[this.dataReceivedNames.data]){if(this.max=parseInt(e[this.dataReceivedNames.last_page])||1,this.progressiveLoad)switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(e[this.dataReceivedNames.data],!1,this.initialLoad&&1==this.page):this.table.rowManager.addRows(e[this.dataReceivedNames.data]),this.page<this.max&&setTimeout(function(){i.nextPage().then(function(){}).catch(function(){})},i.table.options.ajaxProgressiveLoadDelay);break;case"progressive_scroll":e=this.table.rowManager.getData().concat(e[this.dataReceivedNames.data]),this.table.rowManager.setData(e,!0,this.initialLoad&&1==this.page),o=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,i.table.rowManager.element.scrollHeight<=i.table.rowManager.element.clientHeight+o&&i.nextPage().then(function(){}).catch(function(){})}else t=this.table.rowManager.scrollLeft,this.table.rowManager.setData(e[this.dataReceivedNames.data],!1,this.initialLoad&&1==this.page),this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t),this.table.options.pageLoaded.call(this.table,this.getPage());this.initialLoad=!1}else console.warn("Remote Pagination Error - Server response missing '"+this.dataReceivedNames.data+"' property")},_.prototype.footerRedraw=function(){var e=this.table.footerManager.element;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"))},_.prototype.paginationDataSentNames={page:"page",size:"size",sorters:"sorters",filters:"filters"},_.prototype.paginationDataReceivedNames={current_page:"current_page",last_page:"last_page",data:"data"},u.prototype.registerModule("page",_);var N=function(e){this.table=e,this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1};N.prototype.localStorageTest=function(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}},N.prototype.initialize=function(){var e,t=this.table.options.persistenceMode,o=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:this.readers[this.table.options.persistenceReaderFunc]?this.readFunc=this.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):this.readers[this.mode]?this.readFunc=this.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:this.readers[this.table.options.persistenceWriterFunc]?this.writeFunc=this.readers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):this.writers[this.mode]?this.writeFunc=this.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(o||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))},N.prototype.initializeColumn=function(e){var t,o,i=this;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),o=!0===this.config.columns?Object.keys(t):this.coLine truncated
;if(e.modules.sort){if(e.modules.sort.tristate)o="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":o="desc";break;case"desc":o="asc";break;default:o=e.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(i=n.getSort(),s=i.findIndex(function(t){return t.field===e.getField()}),s>-1?(i[s].dir=o,s!=i.length-1&&(s=i.splice(s,1)[0],"none"!=o&&i.push(s))):"none"!=o&&i.push({column:e,dir:o}),n.setSort(i)):"none"==o?n.clear():n.setSort(e,o),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))},U.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},U.prototype.getSort=function(){var e=this,t=[];return e.sortList.forEach(function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})}),t},U.prototype.setSort=function(e,t){var o=this,i=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach(function(e){var t;t=o.table.columnManager.findColumn(e.column),t?(e.column=t,i.push(e),o.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)}),o.sortList=i,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")},U.prototype.clear=function(){this.setSort([])},U.prototype.findSorter=function(e){var t,o=this.table.rowManager.activeRows[0],i="string";if(o&&(o=o.getData(),e.getField()))switch(t=e.getFieldValue(o),void 0===t?"undefined":_typeof(t)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},U.prototype.sort=function(e){var t=this,o=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,i=[];t.table.options.dataSorting&&t.table.options.dataSorting.call(t.table,t.getSort()),t.clearColumnHeaders(),t.table.options.ajaxSorting?o.forEach(function(e,o){t.setColumnHeader(e.column,e.dir)}):(o.forEach(function(e,o){var n=e.column.modules.sort;e.column&&n&&(n.sorter||(n.sorter=t.findSorter(e.column)),e.params="function"==typeof n.params?n.params(e.column.getComponent(),e.dir):n.params,i.push(e)),t.setColumnHeader(e.column,e.dir)}),i.length&&t._sortItems(e,i)),t.table.options.dataSorted&&t.table.options.dataSorted.call(t.table,t.getSort(),t.table.rowManager.getComponents("active"))},U.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(e){e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"))})},U.prototype.setColumnHeader=function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t)},U.prototype._sortItems=function(e,t){var o=this,i=t.length-1;e.sort(function(e,n){for(var s,r=i;r>=0;r--){var a=t[r];if(0!==(s=o._sortRow(e,n,a.column,a.dir,a.params)))break}return s})},U.prototype._sortRow=function(e,t,o,i,n){var s,r,a="asc"==i?e:t,l="asc"==i?t:e;return e=o.getFieldValue(a.getData()),t=o.getFieldValue(l.getData()),e=void 0!==e?e:"",t=void 0!==t?t:"",s=a.getComponent(),r=l.getComponent(),o.modules.sort.sorter.call(this,e,t,s,r,o.getComponent(),i,n)},U.prototype.sorters={number:function(e,t,o,i,n,s,r){var a=r.alignEmptyValues,l=r.decimalSeparator||".",c=r.thousandSeparator||",",u=0;if(e=parseFloat(String(e).split(c).join("").split(l).join(".")),t=parseFloat(String(t).split(c).join("").split(l).join(".")),isNaN(e))u=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;u=1}return("top"===a&&"desc"===s||"bottom"===a&&"asc"===s)&&(u*=-1),u},string:function(e,t,o,i,n,s,r){var a,l=r.alignEmptyValues,c=0;if(e){if(t){switch(_typeof(r.locale)){case"boolean":r.locale&&(a=this.table.modules.localize.getLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}c=1}else c=t?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c},date:function(e,t,o,i,n,s,r){return r.format||(r.format="DD/MM/YYYY"),this.sorters.datetime.call(this,e,t,o,i,n,s,r)},time:function(e,t,o,i,n,s,r){return r.format||(r.format="hh:mm"),this.sorters.datetime.call(this,e,t,o,i,n,s,r)},datetime:function(e,t,o,i,n,s,r){var a=r.format||"DD/MM/YYYY hh:mm:ss",l=r.alignEmptyValues,c=0;if("undefined"!=typeof moment){if(e=moment(e,a),t=moment(t,a),e.isValid()){if(t.isValid())return e-t;c=1}else c=t.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(e,t,o,i,n,s,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,o,i,n,s,r){function a(e){switch(u){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":reLine truncated
File diff suppressed because it is too large. Load diff
+6
View File
@@ -0,0 +1,6 @@
/* Tabulator v4.6.3 (c) Oliver Folkerd */
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<o;){var s=e[n];if(t.call(i,s,n,e))return n;n++}return-1}}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<o;){var s=e[n];if(t.call(i,s,n,e))return s;n++}}});var ColumnManager=function(t){this.table=t,this.blockHozScrollEvent=!1,this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.rowManager=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.element.insertBefore(this.headersElement,this.element.firstChild)};ColumnManager.prototype.createHeadersElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-headers"),t},ColumnManager.prototype.createHeaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-header"),this.table.options.headerVisible||t.classList.add("tabulator-header-hidden"),t},ColumnManager.prototype.initialize=function(){},ColumnManager.prototype.setRowManager=function(t){this.rowManager=t},ColumnManager.prototype.getElement=function(){return this.element},ColumnManager.prototype.getHeadersElement=function(){return this.headersElement},ColumnManager.prototype.scrollHorizontal=function(t){var e=0,o=this.element.scrollWidth-this.table.element.clientWidth;this.element.scrollLeft=t,t>o?(e=t-o,this.element.style.marginLeft=-e+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},ColumnManager.prototype.generateColumnsFromRowData=function(t){var e,o,i=[];if(t&&t.length){e=t[0];for(var n in e){var s={field:n,title:n},l=e[n];switch(void 0===l?"undefined":_typeof(l)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(l)?"array":"string";break;default:o=isNaN(l)||""===l?l.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}s.sorter=o,i.push(s)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},ColumnManager.prototype.setColumns=function(t,e){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),t.forEach(function(t,e){o._addColumn(t)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),o.redraw(!0)},ColumnManager.prototype._addColumn=function(t,e,o){var i=new Column(t,this),n=i.getElement(),s=o?this.findColumnIndex(o):o;if(o&&s>-1){var l=this.columns.indexOf(o.getTopColumn()),a=o.getElement();e?(this.columns.splice(l,0,i),a.parentNode.insertBefore(n,a)):(this.columns.splice(l+1,0,i),a.parentNode.insertBefore(n,a.nextSibling))}else e?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement())),i.columnRendered();return i},ColumnManager.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},ColumnManager.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},ColumnManager.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},ColumnManager.prototype._verticalAlignHeaders=function(){var t=this,e=0;t.columns.forEach(function(t){var o;t.clearVerticalAlign(),(o=t.getHeight())>e&&(e=o)}),t.columns.forEach(function(o){o.verticalAlign(t.table.options.columnHeaderVertAlign,e)}),t.rowManager.adjustTableSize()},ColumnManager.prototype.findColumn=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t)))return this.columnsByField[t]||!1;if(t instanceof Column)return t;if(t instanceof ColumnComponent)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.columns.find(function(e){return e.element===t})||!1}return!1},ColumnManager.prototype.getColumnByField=function(t){return this.columnsByField[t]},ColumnManager.prototype.getColumnsByFieldRoot=function(t){var e=this,o=[];return Object.keys(this.columnsByField).forEach(function(i){i.split(".")[0]===t&&o.push(e.columnsByField[i])Line truncated
e.delete().then(function(){o(t.getComponent())}).catch(function(t){i(t)})}).catch(function(t){i(t)}))})},Column.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Column.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams"],Column.prototype.getComponent=function(){return new ColumnComponent(this)};var RowManager=function(t){this.table=t,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,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=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};RowManager.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t},RowManager.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t},RowManager.prototype.getElement=function(){return this.element},RowManager.prototype.getTableElement=function(){return this.tableElement},RowManager.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},RowManager.prototype.setColumnManager=function(t){this.columnManager=t},RowManager.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRender=!0,t.element.addEventListener("scroll",function(){var e=t.element.scrollLeft;t.scrollLeft!=e&&(t.columnManager.scrollHorizontal(e),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(e),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(e),t.table.options.scrollHorizontal(e)),t.scrollLeft=e}),"virtual"===this.renderMode&&t.element.addEventListener("scroll",function(){var e=t.element.scrollTop,o=t.scrollTop>e;t.scrollTop!=e?(t.scrollTop=e,t.scrollVertical(o),"scroll"==t.table.options.ajaxProgressiveLoad&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-e),t.table.options.scrollVertical(e)):t.scrollTop=e})},RowManager.prototype.findRow=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t))){if(void 0===t||null===t)return!1;return e.rows.find(function(o){return o.data[e.table.options.index]==t})||!1}if(t instanceof Row)return t;if(t instanceof RowComponent)return t._getSelf()||!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){return e.rows.find(function(e){return e.element===t})||!1}return!1},RowManager.prototype.getRowFromDataObject=function(t){return this.rows.find(function(e){return e.data===t})||!1},RowManager.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},RowManager.prototype.scrollToRow=function(t,e,o){var i,n=this,s=this.getDisplayRows().indexOf(t),l=t.getElement(),Line truncated
this._row.table.modules.selectRow.deselectRows(this._row)},RowComponent.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},RowComponent.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},RowComponent.prototype._getSelf=function(){return this._row},RowComponent.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},RowComponent.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},RowComponent.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},RowComponent.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},RowComponent.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},RowComponent.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},RowComponent.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},RowComponent.prototype.reformat=function(){return this._row.reinitialize()},RowComponent.prototype.getGroup=function(){return this._row.getGroup().getComponent()},RowComponent.prototype.getTable=function(){return this._row.table},RowComponent.prototype.getNextRow=function(){var t=this._row.nextRow();return t?t.getComponent():t},RowComponent.prototype.getPrevRow=function(){var t=this._row.prevRow();return t?t.getComponent():t};var Row=function(t,e){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";this.table=e.table,this.parent=e,this.data={},this.type=o,this.element=this.createElement(),this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.setData(t),this.generateElement()};Row.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.setAttribute("role","row"),t},Row.prototype.getElement=function(){return this.element},Row.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},Row.prototype.generateElement=function(){var t,e,o,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),"collapse"===i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout")&&i.table.modules.responsiveLayout.initializeRow(this),i.table.options.rowContextMenu&&this.table.modExists("menu")&&i.table.modules.menu.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(t){i.table.options.rowClick(t,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(t){i.table.options.rowDblClick(t,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(t){i.table.options.rowContext(t,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(t){i.table.options.rowMouseEnter(t,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(t){i.table.options.rowMouseLeave(t,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(t){i.table.options.rowMouseOver(t,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(t){i.table.options.rowMouseOut(t,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(t){i.table.options.rowMouseMove(t,i.getComponent())}),i.table.options.rowTap&&(o=!1,i.element.addEventListener("touchstart",function(t){o=!0},{passive:!0}),i.element.addEventListener("touchend",function(t){o&&i.table.options.rowTap(t,i.getComponent()),o=!1})),i.table.options.rowDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,i.table.options.rowDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.table.options.rowTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,o=!1,i.table.options.rowTapHold(t,i.getComponent())},1e3)},{passive:!0}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null}))},Row.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},Row.protLine truncated
this.options.persistentLayout&&(console.warn("persistentLayout option is deprecated, you should now use the persistence option"),!0!==this.options.persistence&&void 0===this.options.persistence.columns&&(this.options.persistence.columns=!0)),this.options.persistentSort&&(console.warn("persistentSort option is deprecated, you should now use the persistence option"),!0!==this.options.persistence&&void 0===this.options.persistence.sort&&(this.options.persistence.sort=!0)),this.options.persistentFilter&&(console.warn("persistentFilter option is deprecated, you should now use the persistence option"),!0!==this.options.persistence&&void 0===this.options.persistence.filter&&(this.options.persistence.filter=!0)),this.options.columnVertAlign&&(console.warn("columnVertAlign option is deprecated, you should now use the columnHeaderVertAlign option"),this.options.columnHeaderVertAlign=this.options.columnVertAlign)},Tabulator.prototype._clearSelection=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")},Tabulator.prototype._create=function(){this._clearObjectPointers(),this._mapDepricatedFunctionality(),this.bindModules(),"TABLE"===this.element.tagName&&this.modExists("htmlTableImport",!0)&&this.modules.htmlTableImport.parseTable(),this.columnManager=new ColumnManager(this),this.rowManager=new RowManager(this),this.footerManager=new FooterManager(this),this.columnManager.setRowManager(this.rowManager),this.rowManager.setColumnManager(this.columnManager),this._buildElement(),this._loadInitialData()},Tabulator.prototype._clearObjectPointers=function(){this.options.columns=this.options.columns.slice(0),this.options.reactiveData||(this.options.data=this.options.data.slice(0))},Tabulator.prototype._buildElement=function(){var t=this,e=this.element,o=this.modules,i=this.options;for(i.tableBuilding.call(this),e.classList.add("tabulator"),e.setAttribute("role","grid");e.firstChild;)e.removeChild(e.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",e.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",e.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",e.style.maxHeight=i.maxHeight),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modExists("layout",!0)&&o.layout.initialize(i.layout),!1!==i.headerFilterPlaceholder&&o.localize.setHeaderFilterPlaceholder(i.headerFilterPlaceholder);for(var n in i.langs)o.localize.installLang(n,i.langs[n]);if(o.localize.setLocale(i.locale),"string"==typeof i.placeholder){var s=document.createElement("div");s.classList.add("tabulator-placeholder");var l=document.createElement("span");l.innerHTML=i.placeholder,s.appendChild(l),i.placeholder=s}if(e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),i.footerElement&&this.footerManager.activate(),i.persistence&&this.modExists("persistence",!0)&&o.persistence.initialize(),i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.columns&&(i.columns=o.persistence.load("columns",i.columns)),i.movableRows&&this.modExists("moveRow")&&o.moveRow.initialize(),i.autoColumns&&this.options.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modExists("columnCalcs")&&o.columnCalcs.initialize(),this.columnManager.setColumns(i.columns),i.dataTree&&this.modExists("dataTree",!0)&&o.dataTree.initialize(),this.modExists("frozenRows")&&this.modules.frozenRows.initialize(),(i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.sort||i.initialSort)&&this.modExists("sort",!0)){var a=[];i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.sort?!1===(a=o.persistence.load("sort"))&&i.initialSort&&(a=i.initialSort):i.initialSort&&(a=i.initialSort),o.sort.setSort(a)}if((i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.filter||i.initialFilter)&&this.modExists("filter",!0)){var r=[];i.persistence&&this.modExists("persistence",!0)&&o.persistence.config.filter?!1===(r=o.persistence.load("filter"))&&i.initialFilter&&(r=i.initialFilter):i.initialFilter&&(r=i.initialFilter),o.filter.setFilter(r)}i.initialHeaderFilter&&this.modExists("filter",!0)&&i.initialHeaderFilter.forEach(function(e){var i=t.columnManager.findColumn(e.field);if(!i)return console.warn("Column Filter Error - No matching column found:",e.field),!1;o.filter.setHeaderFilterValue(i,e.value)}),this.modExists("ajax")&&o.ajax.initialize(),i.pagination&&this.modExists("page",!0)&&o.page.initialize(),i.groupBy&&this.modExists("groupRows",!0)&&o.groupRows.initialize(),this.modExists("keybindings")&&o.keybindings.initialize(),this.modExists("selectRow")&&o.selectRow.clearSLine truncated
;t.column.minWidth>=o?r.push(t):(m.push(t),d+=s?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),r.length?(r.forEach(function(t){u+=s?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),c=i-u,h=d?Math.floor(c/d):c,p=c-h*d,p+=o(m,c,h,s)):(p=d?i-Math.floor(i/d)*d:i,m.forEach(function(t){t.width=s?a(t):l(t)})),p}var i=this,n=i.table.element.clientWidth,s=0,l=0,a=0,r=0,u=[],c=[],h=0,p=0,d=0;this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(n-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach(function(t){var o,i,n;t.visible&&(o=t.definition.width,i=parseInt(t.minWidth),o?(n=e(o),s+=n>i?n:i,t.definition.widthShrink&&(c.push({column:t,width:n>i?n:i}),h+=t.definition.widthShrink)):(u.push({column:t,width:0}),a+=t.definition.widthGrow||1))}),l=n-s,r=Math.floor(l/a);var d=o(u,l,r,!1);u.length&&d>0&&(u[u.length-1].width+=+d),u.forEach(function(t){l-=t.width}),p=Math.abs(d)+l,p>0&&h&&(d=o(c,p,Math.floor(p/h),!0)),c.length&&(c[c.length-1].width-=d),u.forEach(function(t){t.column.setWidth(t.width)}),c.forEach(function(t){t.column.setWidth(t.width)})}},Tabulator.prototype.registerModule("layout",Layout);var Localize=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={}};Localize.prototype.setHeaderFilterPlaceholder=function(t){this.langs.default.headerFilters.default=t},Localize.prototype.setHeaderFilterColumnPlaceholder=function(t,e){this.langs.default.headerFilters.columns[t]=e,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=e)},Localize.prototype.installLang=function(t,e){this.langs[t]?this._setLangProp(this.langs[t],e):this.langs[t]=e},Localize.prototype._setLangProp=function(t,e){for(var o in e)t[o]&&"object"==_typeof(t[o])?this._setLangProp(t[o],e[o]):t[o]=e[o]},Localize.prototype.setLocale=function(t){function e(t,o){for(var i in t)"object"==_typeof(t[i])?(o[i]||(o[i]={}),e(t[i],o[i])):o[i]=t[i]}var o=this;if(t=t||"default",!0===t&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!o.langs[t]){var i=t.split("-")[0];o.langs[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")}o.locale=t,o.lang=Tabulator.prototype.helpers.deepClone(o.langs.default||{}),"default"!=t&&e(o.langs[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()},Localize.prototype.getLocale=function(t){return self.locale},Localize.prototype.getLang=function(t){return t?this.langs[t]:this.lang},Localize.prototype.getText=function(t,e){var t=e?t+"|"+e:t,o=t.split("|");return this._getLangElement(o,this.locale)||""},Localize.prototype._getLangElement=function(t,e){var o=this,i=o.lang;return t.forEach(function(t){var e;i&&(e=i[t],i=void 0!==e&&e)}),i},Localize.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},Localize.prototype._executeBindings=function(){var t=this;for(var e in t.bindings)!function(e){t.bindings[e].forEach(function(o){o(t.getText(e),t.lang)})}(e)},Localize.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page"},headerFilters:{default:"filter column...",columns:{}}}},Tabulator.prototype.registerModule("localize",Localize);var Comms=function(t){this.table=t};Comms.prototype.getConnections=function(t){var e,o=this,i=[];return e=Tabulator.prototype.comms.lookupTable(t),e.forEach(function(t){o.table!==t&&i.push(t)}),i},Comms.prototype.send=function(t,e,o,i){var n=this,s=this.getConnections(t);s.forEach(function(t){t.tableComms(n.table.element,e,o,i)}),!s.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},Comms.prototype.receive=function(t,e,o,i){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,o,i);console.warn("Inter-table Comms Error - no such module:",e)},Tabulator.prototype.registerModule("comms",Comms);