@perspective-dev/viewer-datagrid 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +193 -0
- package/dist/cdn/perspective-viewer-datagrid.js +47 -0
- package/dist/cdn/perspective-viewer-datagrid.js.map +7 -0
- package/dist/css/perspective-viewer-datagrid-toolbar.css +1 -0
- package/dist/css/perspective-viewer-datagrid.css +1 -0
- package/dist/esm/perspective-viewer-datagrid.js +16 -0
- package/dist/esm/perspective-viewer-datagrid.js.map +7 -0
- package/index.d.ts +35 -0
- package/package.json +45 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:host{position:relative;display:block;height:100%;}:host #container{position:absolute;display:flex;flex-direction:column;justify-content:stretch;align-items:stretch;top:0;left:0;right:0;bottom:0;}:host #toolbar{display:flex;align-items:stretch;height:100%;}:host #toolbar .hover-target{margin:0;display:inline-flex;align-items:center;cursor:pointer;}:host #toolbar .hover-target:hover{box-shadow:-4px 0 0 var(--icon--color),4px 0 0 var(--icon--color);background-color:var(--icon--color);}:host #slot-container{flex:1;position:relative;}#scroll_lock.lock-scroll:before{-webkit-mask-image:var(--toolbar-scroll-lock-active--content);}#scroll_lock:before{-webkit-mask-image:var(--toolbar-scroll-lock--content);}#select_mode:before{content:"highlight_alt";}#edit_mode:before{-webkit-mask-image:"";}#edit_mode[data-edit-mode="READ_ONLY"]:before{-webkit-mask-image:var(--toolbar-edit-mode--read-only--content);}#edit_mode[data-edit-mode="EDIT"]:before{-webkit-mask-image:var(--toolbar-edit-mode--edit--content);}:host(.aggregated) #toolbar #edit_mode[data-edit-mode="EDIT"]:before{-webkit-mask-image:var(--toolbar-edit-mode--read-only--content);}#edit_mode[data-edit-mode="SELECT_ROW"]:before{-webkit-mask-image:var(--toolbar-edit-mode--select-row--content);}#edit_mode[data-edit-mode="SELECT_COLUMN"]:before{-webkit-mask-image:var(--toolbar-edit-mode--select-column--content);}#edit_mode[data-edit-mode="SELECT_REGION"]:before{-webkit-mask-image:var(--toolbar-edit-mode--select-region--content);}#edit_mode[data-edit-mode="READ_ONLY"] span:before{content:var(--edit-mode--read-only--content,"Read Only");}#edit_mode[data-edit-mode="EDIT"] span:before{content:var(--edit-mode--edit--content,"Editable");}#edit_mode[data-edit-mode="SELECT_ROW"] span:before{content:var(--edit-mode--select-row--content,"Row Select");}#edit_mode[data-edit-mode="SELECT_COLUMN"] span:before{content:var(--edit-mode--select-column--content,"Column Select");}#edit_mode[data-edit-mode="SELECT_REGION"] span:before{content:var(--edit-mode--select-region--content,"Region Select");}#scroll_lock span:before{content:var(--scroll-lock-toggle--content,"Free Scroll");}#scroll_lock.lock-scroll span:before{content:var(--scroll-lock-alt-toggle--content,"Align Scroll");}.button:before{width:21px;height:21px;content:"";-webkit-mask-size:cover;mask-size:cover;background-color:var(--icon--color);}.button.editable:before,.button.lock-scroll:before{color:inherit;}.button{display:inline-flex;justify-content:center;align-items:center;user-select:none;padding:0 5px;border:1px solid transparent;border-radius:3px;border:1px solid transparent;box-sizing:border-box;display:inline-flex;font-size:var(--label--font-size,0.75em);height:22px;user-select:none;white-space:nowrap;width:37px;}.button>span{display:none;margin:0;padding:0;}.hover-target:focus-within .button,.hover-target:hover .button{position:relative;background-color:var(--icon--color);color:var(--plugin--background);opacity:1;display:flex;align-items:center;cursor:pointer;}.hover-target:focus-within .button:before,.hover-target:hover .button:before{background-color:var(--plugin--background);}.hover-target:focus-within .button>span,.hover-target:hover .button>span{display:block;position:absolute;top:calc(100% + 3px);left:50%;translate:-50%;margin:0;padding:5px;height:auto;white-space:pre-wrap;line-height:1;font-size:9px;background-color:var(--icon--color);width:35px;text-align:center;border-radius:0 0 3px 3px;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
regular-table{padding:0;margin:12px 0 0 12px;font-family:inherit;--rt-hover--border-color:var(--inactive--color,#c5c9d080);}regular-table div[tabindex]{outline:none;}regular-table>div{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;}regular-table th{text-align:center;}regular-table thead tr:not(.rt-autosize) th{overflow:hidden;max-width:0px;}regular-table thead tr:last-child .rt-float,regular-table tbody .rt-float{text-align:right;}regular-table thead .rt-integer,regular-table tbody .rt-integer{text-align:right;}regular-table tbody th{text-align:left;}regular-table span.rt-tree-container{display:flex;align-items:center;height:100%;}regular-table thead .rt-string,regular-table tbody .rt-string,regular-table thead .rt-date,regular-table tbody .rt-date,regular-table thead .rt-datetime,regular-table tbody .rt-datetime{text-align:left;}regular-table thead tr:last-child th{border-bottom:1px solid#8b868045;}regular-table tbody tr:first-child td,regular-table tbody tr:first-child th{border-top:1px solid transparent!important;}regular-table th{position:relative;}regular-table tr th span.rt-tree-group{margin-left:5px;margin-right:15px;border-left:1px solid#eee;height:100%;}regular-table td,regular-table th{white-space:nowrap;font-size:12px;padding-right:5px;padding-left:5px;padding-top:0px;padding-bottom:0px;height:19px;}regular-table table *{box-sizing:border-box;}regular-table table{position:absolute;color:#666;outline:none;}regular-table span.rt-row-header-icon{color:#aaa;padding-right:4px;font-family:var(--button--font-family);}regular-table span.rt-column-header-icon{font-size:10px;padding-left:3px;display:inline-block;width:10px;font-family:var(--button--font-family);}regular-table span.rt-row-header-icon:hover{color:#1a7da1;text-shadow:0px 0px 3px#1a7da1;}regular-table .rt-selected td{background-color:#eee;}regular-table .rt-cell-clip{overflow:hidden;text-overflow:ellipsis;}regular-table td span.rt-group-name,regular-table th span.rt-group-name{margin-right:-5px;padding-right:5px;padding-left:8px;flex:1;height:100%;}regular-table th span.rt-group-name{text-align:left;}regular-table td th span.rt-group-leaf,regular-table th span.rt-group-leaf{margin-left:16px;height:100%;}regular-table .rt-column-resize{height:100%;width:10px;position:absolute;top:0;right:0;cursor:col-resize;}regular-table a{color:var(--rt-pos-cell--color);}regular-table a:visited{color:var(--active--color);}regular-table td.psp-null:after,regular-table th.psp-null:after{content:var(--null--content,"-");}.psp-header-border:not(.psp-is-top):not(.psp-header-leaf){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}.psp-header-group{box-shadow:0px 10px 0 -9px var(--inactive--border-color,#8b868045);}.psp-is-top{box-shadow:5px 4px 0px -4px var(--inactive--border-color,#8b868045);}.psp-is-top.psp-header-group:not(.psp-header-group-corner){box-shadow:5px 4px 0px -4px var(--inactive--border-color,#8b868045),0px 10px 0 -9px var(--inactive--border-color,#8b868045);}.psp-header-border.psp-header-group:not(.psp-is-top):not(.psp-header-group-corner){box-shadow:1px 0px var(--inactive--border-color,#8b868045),0px 10px 0 -9px var(--inactive--border-color,#8b868045);}perspective-viewer[settings] tr.rt-autosize .psp-header-leaf.psp-header-border:not(.psp-menu-enabled){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}:host-context(perspective-viewer[settings]) tr.rt-autosize .psp-header-leaf.psp-header-border:not(.psp-menu-enabled){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}.psp-header-leaf.psp-header-border{box-shadow:5px -4px 0px -4px var(--inactive--border-color,#8b868045);}tr:only-child th{box-shadow:none!important;}regular-table tbody tr:hover th.psp-tree-leaf:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover th.psp-tree-label:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover td:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover:after{border-color:var(--rt-hover--border-color,#c5c9d080)!important;box-shadow:0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:hover th.psp-tree-leaf.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover th.psp-tree-label.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover td.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr.psp-menu-open:hover:after{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:last-child:hover td.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected){box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),inset 0px -2px 0px var(--icon--color),0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:hover+tr th.psp-tree-leaf:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover+tr th.psp-tree-label:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover+tr td:not(.psp-row-selected):not(.psp-row-subselected){border-top-color:transparent;}regular-table tbody tr th:first-child:not(:empty),regular-table tbody tr th:first-child:empty+th:not(:empty),regular-table tbody tr th:first-child:empty~th:empty+th:not(:empty),regular-table tbody tr td:first-child{border-left-width:1px;border-left-color:transparent;}regular-table tbody tr th:last-child,regular-table tbody tr td:last-child{border-right-width:0px;border-right-color:transparent;}regular-table tbody tr:hover{color:inherit;}regular-table tbody tr:hover th:first-child:not(:empty),regular-table tbody tr:hover th:first-child:empty+th:not(:empty),regular-table tbody tr:hover th:first-child:empty~th:empty+th:not(:empty),regular-table tbody tr:hover td:first-child{border-left-color:var(--rt-hover--border-color,#c5c9d080)!important;}regular-table tbody tr:hover th:last-child,regular-table tbody tr:hover td:last-child{border-right-color:var(--rt-hover--border-color,#c5c9d080)!important;}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody td,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead th:not(.rt-group-corner),:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody td,:host(:not(.sub-cell-scroll-disabled)) regular-table table thead th:not(.rt-group-corner){transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody{transform:translate(0,var(--regular-table--transform-y,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child td,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child th,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child td,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child th,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child:after{clip-path:polygon(0 var(--regular-table--clip-y,0),0 200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr td:first-of-type,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr td:first-of-type{clip-path:polygon(var(--regular-table--clip-x,0) 0,var(--regular-table--clip-x,0) 200%,200% 200%,200% 0);}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child td:first-of-type,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child td:first-of-type{clip-path:polygon(var(--regular-table--clip-x,0) var(--regular-table--clip-y,0),var(--regular-table--clip-x,0) 200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead tr:last-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table thead tr:last-child:after{transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:not(:first-child):after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:not(:first-child):after{transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:hover:first-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:hover:first-child:after{clip-path:polygon(0 var(--regular-table--clip-y,0),0 200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead tr th.rt-group-corner+th:not(.rt-group-corner),:host(:not(.sub-cell-scroll-disabled)) regular-table table thead tr th.rt-group-corner+th:not(.rt-group-corner){clip-path:polygon(var(--regular-table--clip-x,0) 0,var(--regular-table--clip-x,0) 200%,200% 200%,200% 0);}regular-table{outline:none;}regular-table::-webkit-scrollbar,regular-table::-webkit-scrollbar-corner{background-color:transparent;height:12px;width:12px;}regular-table::-webkit-scrollbar-thumb{background-clip:content-box;background:var(--icon--color);border:5.5px solid var(--plugin--background);max-height:50%;max-width:50%;min-width:10%;min-height:10%;}perspective-viewer:not([settings]) regular-table table tr.rt-autosize+tr th{height:0px;}perspective-viewer:not([settings]) regular-table table tr.rt-autosize+tr th span{display:none;}:host-context(perspective-viewer:not([settings])) regular-table table tr.rt-autosize+tr th{height:0px;}:host-context(perspective-viewer:not([settings])) regular-table table tr.rt-autosize+tr th span{display:none;}perspective-viewer[settings] .psp-menu-enabled{padding:0 6px;font-size:8px;border-radius:3px 3px 0 0;}perspective-viewer[settings] .psp-menu-enabled:hover,perspective-viewer[settings] tr:not(.rt-autosize) th.psp-menu-open{color:var(--plugin--background);background-color:var(--icon--color);border-bottom-color:var(--icon--color);cursor:pointer;}perspective-viewer[settings] tr:not(.rt-autosize) th.psp-menu-open:before{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;height:8px;width:10px;-webkit-mask-image:var(--column-settings-icon--mask-image);mask-image:var(--column-settings-icon--mask-image);margin-right:4px;background-color:var(--plugin--background);}perspective-viewer[settings] td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color);}perspective-viewer[settings] tr:first-child td.psp-menu-open{border-top-color:var(--icon--color)!important;}perspective-viewer[settings] tr:last-child td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),inset 0px -2px 0px var(--icon--color);}:host-context(perspective-viewer[settings]) .psp-menu-enabled{padding:0 6px;font-size:8px;border-radius:3px 3px 0 0;}:host-context(perspective-viewer[settings]) .psp-menu-enabled:hover,:host-context(perspective-viewer[settings]) tr:not(.rt-autosize) th.psp-menu-open{color:var(--plugin--background);background-color:var(--icon--color);border-bottom-color:var(--icon--color);cursor:pointer;}:host-context(perspective-viewer[settings]) tr:not(.rt-autosize) th.psp-menu-open:before{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;height:8px;width:10px;-webkit-mask-image:var(--column-settings-icon--mask-image);mask-image:var(--column-settings-icon--mask-image);margin-right:4px;background-color:var(--plugin--background);}:host-context(perspective-viewer[settings]) td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color);}:host-context(perspective-viewer[settings]) tr:first-child td.psp-menu-open{border-top-color:var(--icon--color)!important;}:host-context(perspective-viewer[settings]) tr:last-child td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),inset 0px -2px 0px var(--icon--color);}perspective-viewer regular-table table thead tr:last-child th{border-bottom-width:1px;border-bottom-color:var(--inactive--border-color,#8b868045);}:host-context(perspective-viewer) regular-table table thead tr:last-child th{border-bottom-width:1px;border-bottom-color:var(--inactive--border-color,#8b868045);}.psp-sort-enabled:hover{cursor:pointer;}.psp-row-selected,:hover .psp-row-selected,:hover th.psp-tree-leaf.psp-row-selected,:hover th.psp-tree-label.psp-row-selected{color:white!important;background-color:var(--selected-row--background-color,#ea7319)!important;border-color:var(--selected-row--background-color,#ea7319)!important;}.psp-row-selected.psp-tree-label:not(:hover):before{color:white;}.psp-row-subselected,:hover .psp-row-subselected,:hover th.psp-tree-leaf.psp-row-subselected,:hover th.psp-tree-label.psp-row-subselected{background:rgba(234,115,25,0.2)!important;}.psp-error{color:red;}td:focus{outline:#666;outline-style:dotted;outline-width:1px;}perspective-viewer.dragging regular-table{pointer-events:none;}:host-context(perspective-viewer.dragging) regular-table{pointer-events:none;}.psp-header-border:last-child{border-right-width:0px;}.psp-header-sort-desc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-desc-icon--mask-image);mask-image:var(--sort-desc-icon--mask-image);}.psp-header-sort-asc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-asc-icon--mask-image);mask-image:var(--sort-asc-icon--mask-image);}.psp-header-sort-col-desc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-col-desc-icon--mask-image);mask-image:var(--sort-col-desc-icon--mask-image);}.psp-header-sort-col-asc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-col-asc-icon--mask-image);mask-image:var(--sort-col-asc-icon--mask-image);}.psp-header-sort-abs-desc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-abs-desc-icon--mask-image);mask-image:var(--sort-abs-desc-icon--mask-image);}.psp-header-sort-abs-asc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-abs-asc-icon--mask-image);mask-image:var(--sort-abs-asc-icon--mask-image);}.psp-header-sort-abs-col-desc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-abs-col-desc-icon--mask-image);mask-image:var(--sort-abs-col-desc-icon--mask-image);}.psp-header-sort-abs-col-asc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-abs-col-asc-icon--mask-image);mask-image:var(--sort-abs-col-asc-icon--mask-image);}tbody th:last-of-type{border-right:1px solid var(--inactive--border-color,#8b868045);overflow:hidden;text-overflow:ellipsis;}tbody th:empty{background-image:linear-gradient(to right,transparent 9px,var(--inactive--border-color,#eee) 10px,transparent 11px);background-repeat:no-repeat;min-width:20px;max-width:20px;pointer-events:none;}.psp-tree-label{max-width:0px;min-width:0px;}.psp-tree-label:before{color:var(--icon--color);font-family:var(--button--font-family,inherit);padding-right:11px;}.psp-tree-label-expand:before{content:var(--tree-label-expand--content,"+");}.psp-tree-label-collapse:before{content:var(--tree-label-collapse--content,"-");}.psp-tree-label-expand,.psp-tree-label-collapse{cursor:pointer;}.psp-tree-label:hover:before{color:var(--active--color);text-shadow:0px 0px 5px var(--active--color);}.psp-tree-leaf{padding-left:24px;}.psp-align-right{text-align:right;}.psp-align-left{text-align:left;}.psp-positive:not(:focus){color:var(--rt-pos-cell--color);}.psp-negative:not(:focus){color:var(--rt-neg-cell--color);}regular-table table tbody td{min-width:52px!important;}.psp-is-width-override .rt-column-resize,.rt-column-resize:hover{border:1px dashed#999;border-bottom-width:0px;border-left-width:0px;}.boolean-editable{cursor:pointer;}regular-table table{user-select:none;color:inherit;border-collapse:separate;}regular-table table th{font-weight:400;}regular-table table td,regular-table table th{border-color:var(--inactive--border-color,#8b868045);height:23px;}regular-table table .psp-header-group{text-overflow:ellipsis;}regular-table table th.psp-header-leaf{border-bottom-width:0px;}regular-table table th.psp-header-leaf span{height:23px;min-height:23px;}regular-table table td,regular-table table th.psp-tree-label,regular-table table th.psp-tree-label,regular-table table th.psp-tree-leaf,regular-table table tbody tr:first-child th{border-style:solid;border-width:0px;border-top-width:1px;}regular-table table tbody th:empty{background-position:0px -10px;}regular-table table td.psp-select-region,regular-table table th.psp-select-region{background-color:var(--icon--color)!important;color:var(--plugin--background)!important;border-color:var(--plugin--background)!important;}regular-table tbody tr:hover td.psp-select-region:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover+tr td.psp-select-region:not(.psp-row-selected):not(.psp-row-subselected){border-color:var(--plugin--background)!important;}regular-table tbody tr:hover td.psp-select-region.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected){box-shadow:inset -2px 0px 0px var(--plugin--background),inset 2px 0px 0px var(--plugin--background);}:host-context(perspective-viewer[settings]) td.psp-select-region.psp-menu-open{box-shadow:inset -2px 0px 0px var(--plugin--background),inset 2px 0px 0px var(--plugin--background);}regular-table #psp-column-edit-buttons th:not(.rt-group-corner) span:not(.rt-column-resize):before{content:var(--datagrid-column-edit-button--content,"Edit");}perspective-viewer:not([settings]) regular-table #psp-column-edit-buttons:after{content:none;}:host-context(perspective-viewer:not([settings])) regular-table #psp-column-edit-buttons:after{content:none;}regular-table table thead tr:last-child:after{width:10000px;box-sizing:border-box;display:block;height:23px;content:" ";border-bottom:1px solid var(--inactive--border-color);}regular-table table tbody tr:after{width:10000px;box-sizing:border-box;display:block;height:23px;content:" ";border-top:1px solid transparent;}regular-table table tbody tr:not(:first-child):after{border-top:1px solid var(--inactive--border-color);}regular-table table tbody tr:hover:not(:first-child):after{border-top:1px solid var(--rt-hover--border-color);}regular-table table tbody tr:hover+tr:after{border-top:1px solid var(--rt-hover--border-color);}@keyframes pulse_pos{0%{background-color:var(--pulse--background-color-start,rgba(0,128,255,0.5));}100%{background-color:var(--pulse--background-color-end,rgba(0,128,255,0));}}@keyframes pulse_pos2{0%{background-color:var(--pulse--background-color-start,rgba(0,128,255,0.5));}100%{background-color:var(--pulse--background-color-end,rgba(0,128,255,0));}}@keyframes pulse_neg{0%{background-color:var(--pulse--background-color-start,rgba(255,25,0,0.5));}100%{background-color:var(--pulse--background-color-end,rgba(255,25,0,0));}}@keyframes pulse_neg2{0%{background-color:var(--pulse--background-color-start,rgba(255,25,0,0.5));}100%{background-color:var(--pulse--background-color-end,rgba(255,25,0,0));}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import"regular-table";var k=Symbol("Plugin Symbol");function Je(e){return e.x>=0?this._column_types[e.x]:this._row_header_types[e.row_header_x-1]}function Z(e,t,r){let s=Array.from(e.children[0].children[0].children),o=s.length,l=t.hasAttribute("settings");if(o<=1?s[0]?.removeAttribute("id"):s.forEach((i,n)=>{let a=l?1:0,c=n===o-(a+1)?"psp-column-titles":n===o-a?"psp-column-edit-buttons":null;c?i.setAttribute("id",c):i.removeAttribute("id")}),t.classList.toggle("psp-menu-open",!!r),l&&o>=2){let i=Array.from(s[o-2].children),n=Array.from(s[o-1].children);if(i&&n){s.slice(0,o-2).forEach(a=>{Array.from(a.children).forEach(c=>{c.classList.toggle("psp-menu-open",!1)})});for(let a=0;a<i.length;a++){let c=i[a],d=n[a],p=c.textContent===r;if(c.classList.toggle("psp-menu-open",p),d.classList.toggle("psp-menu-open",p),this._config.columns.length>1)for(let h of e.querySelectorAll("td")){let u=e.getMeta(h),_=u.column_header[u.column_header.length-2]===r;h.classList.toggle("psp-menu-open",_)}}}}}function le(e,t){let r=Array.from(e.children[0].children[0].children);if(r.length>0){Z.call(this,e,t,this._column_settings_selected_column);let[s]=r.splice(this._config.split_by.length,1);s&&se.call(this,e,s,!1);let[o]=r.splice(this._config.split_by.length,1);o&&se.call(this,e,o,!0)}}function se(e,t,r){let s=e._view_cache.config.row_pivots.length-1;for(let o of t.children){let l=e.getMeta(o),i=l.column_header?.[this._config.split_by.length],n=this._config.sort.find(m=>m[0]===i),a=l.row_header_x===s,c=typeof l.x>"u";a=a||(l.x+1)%this._config.columns.length===0,o.classList.toggle("psp-header-border",a),o.classList.toggle("psp-header-group",!1),o.classList.toggle("psp-header-leaf",!0),o.classList.toggle("psp-is-top",!1),o.classList.toggle("psp-header-corner",c),o.classList.toggle("psp-header-sort-asc",!r&&!!n&&n[1]==="asc"),o.classList.toggle("psp-header-sort-desc",!r&&!!n&&n[1]==="desc"),o.classList.toggle("psp-header-sort-col-asc",!r&&!!n&&n[1]==="col asc"),o.classList.toggle("psp-header-sort-col-desc",!r&&!!n&&n[1]==="col desc"),o.classList.toggle("psp-header-sort-abs-asc",!r&&!!n&&n[1]==="asc abs"),o.classList.toggle("psp-header-sort-abs-desc",!r&&!!n&&n[1]==="desc abs"),o.classList.toggle("psp-header-sort-abs-col-asc",!r&&!!n&&n[1]==="col asc abs"),o.classList.toggle("psp-header-sort-abs-col-desc",!r&&!!n&&n[1]==="col desc abs");let d=Je.call(this,l),p=d==="integer"||d==="float",h=d==="string",u=d==="date",_=d==="datetime";o.classList.toggle("psp-align-right",p),o.classList.toggle("psp-align-left",!p),o.classList.toggle("psp-menu-enabled",(h||p||u||_)&&!c&&l.column_header_y==this._config.split_by.length+1),o.classList.toggle("psp-sort-enabled",(h||p||u||_)&&!c&&l.column_header_y===this._config.split_by.length),o.classList.toggle("psp-is-width-override",e._column_sizes?.override[l.size_key]!==void 0)}}function ie(e){let t=e._view_cache.config.row_pivots.length-1,r=Array.from(e.children[0].children[0].children),s=[],o=new Set,l=e.children[0];for(let i=0;i<r.length;i++){let n=l.rows[i],a=new Set;for(let c=0;c<n.cells.length;c++){let d=n.cells[c];d.style.backgroundColor="";let p=e.getMeta(d),h=t>0&&p.row_header_x===t||p.x>=0;d.classList.toggle("psp-align-right",!1),d.classList.toggle("psp-align-left",!1),d.classList.toggle("psp-header-group",!0),d.classList.toggle("psp-header-leaf",!1),d.classList.toggle("psp-header-border",h),d.classList.toggle("psp-header-group-corner",typeof p.x>"u"),d.classList.toggle("psp-color-mode-bar",!1),d.classList.toggle("psp-header-sort-asc",!1),d.classList.toggle("psp-header-sort-desc",!1),d.classList.toggle("psp-header-sort-col-asc",!1),d.classList.toggle("psp-header-sort-col-desc",!1),d.classList.toggle("psp-sort-enabled",!1);let u=n.cells[c],_=c,m,f;for(;s[i]&&s[i][_];++_);for(a.add(_),m=_;m<_+u.colSpan;++m)for(f=i;f<i+u.rowSpan;++f)s[f]||(s[f]=[]),s[f][m]=!0;u.classList.toggle("psp-is-top",i===0||!o.has(m))}o=a}}function ne(e,t,[,,,,,r,s],[,,,,,o,l],i){let n=this._ids?.[e.dy]?.join("|"),a=(i?e.column_header.slice(0,-1):e.column_header).join("|");if(this.last_reverse_columns?.has(a)&&this.last_reverse_ids?.has(n)){let c=this.last_reverse_ids?.get(n),d=this.last_reverse_columns.get(a);this._is_old_viewport?this.last_meta?.[d]?.[c]>e.user?(t.style.setProperty("--pulse--background-color-start",o),t.style.setProperty("--pulse--background-color-end",l),t.style.animationName==="pulse_neg"?t.style.animation="pulse_neg2 0.5s linear":t.style.animation="pulse_neg 0.5s linear"):this.last_meta?.[d]?.[c]<e.user?(t.style.setProperty("--pulse--background-color-start",r),t.style.setProperty("--pulse--background-color-end",s),t.style.animationName==="pulse_pos"?t.style.animation="pulse_pos2 0.5s linear":t.style.animation="pulse_pos 0.5s linear"):c!==e.dy&&(t.style.animation=""):t.style.animation=""}else t.style.animation=""}import ae from"chroma-js";function X(e,t){return ae.mix(e,`rgb(${t[0]},${t[1]},${t[2]})`,.5).hex()}function A([e,t,r,s],o=[255,255,255]){function l(i,n){return((1-s)*(o[i]/255)+s*(n/255))*255}return[l(0,e),l(1,t),l(2,r)]}function T([e,t,r]){return Math.sqrt(e*e*.299+t*t*.587+r*r*.114)>130?"#161616":"#ffffff"}function Ke(e){let[t,r,s]=e.rgb(),[o,l,i]=e.set("hsl.h",(e.get("hsl.h")-15)%360).rgb(),[n,a,c]=e.set("hsl.h",(e.get("hsl.h")+15)%360).rgb();return`linear-gradient(to right top,rgb(${o},${l},${i}),rgb(${t},${r},${s}) 50%,rgb(${n},${a},${c}))`}function O(e){let t=ae(e),r=Ke(t),s=t.rgb();return[e,...s,r,`rgba(${s[0]},${s[1]},${s[2]},1)`,`rgba(${s[0]},${s[1]},${s[2]},0)`]}function ce(e,t,r,s){let o=r.user>0,l=r.user<0,i;e?.pos_bg_color!==void 0?i=e.pos_bg_color:i=this._pos_bg_color;let n;e?.neg_bg_color!==void 0?n=e.neg_bg_color:n=this._neg_bg_color;let a=o?i:l?n:["",...this._plugin_background,""];{let[_,m,f,b,v]=a;if(t.style.position="",r._is_hidden_by_aggregate_depth)t.style.animation="",t.style.backgroundColor="";else if(e?.number_bg_mode==="color")t.style.animation="",t.style.backgroundColor=_;else if(e?.number_bg_mode==="gradient"){let E=Math.max(0,Math.min(1,Math.abs(r.user/e.bg_gradient))),R=this._plugin_background,M=T(A([m,f,b,E],R));t.style.animation="",t.style.color=M,t.style.backgroundColor=`rgba(${m},${f},${b},${E})`}else e?.number_bg_mode==="pulse"?(ne.call(this,r,t,i,n,s),t.style.backgroundColor=""):(e?.number_bg_mode==="disabled"||e?.number_bg_mode,t.style.animation="",t.style.backgroundColor="")}let[c,d,p,h,u]=e?.pos_fg_color!==void 0?o?e.pos_fg_color:l?e.neg_fg_color:["",...this._plugin_background,""]:o?this._pos_fg_color:l?this._neg_fg_color:["",...this._plugin_background,""];if(r._is_hidden_by_aggregate_depth)t.style.backgroundColor="",t.style.color="";else if(e?.number_fg_mode==="disabled")if(e?.number_bg_mode==="color"){let _=this._plugin_background,m=T(A([a[1],a[2],a[3],1],_));t.style.color=m}else e?.number_bg_mode==="gradient"||(t.style.color="");else e?.number_fg_mode==="bar"?(t.style.color="",t.style.position="relative",u!==""&&t.children.length>0&&t.children[0].nodeType===Node.ELEMENT_NODE&&(t.children[0].style.background=u)):(e?.number_fg_mode==="color"||!e?.number_fg_mode)&&(t.style.color=c)}import de from"chroma-js";function pe(e,t,r){let s=r.column_header?.[this._config.split_by.length],[o,l,i,n,a]=e?.color!==void 0?e.color:this._color;if(r._is_hidden_by_aggregate_depth)t.style.backgroundColor="",t.style.color="";else if(e?.string_color_mode==="foreground"&&r.user!==null)t.style.color=o,t.style.backgroundColor="",e?.format==="link"&&(t.children[0].style.color=o);else if(e?.string_color_mode==="background"&&r.user!==null){let c=this._plugin_background,d=T(A([l,i,n,1],c));t.style.color=d,t.style.backgroundColor=o}else if(e?.string_color_mode==="series"&&r.user!==null){this._series_color_map.has(s)||(this._series_color_map.set(s,new Map),this._series_color_seed.set(s,0));let c=this._series_color_map.get(s);if(!c.has(r.user)){let M=this._series_color_seed.get(s);c.set(r.user,M),this._series_color_seed.set(s,M+1)}let d=c.get(r.user),[p,h,u]=de(o).hsl();p=p+d*150%360;let _=de(p,h,u,"hsl"),[m,f,b]=_.rgb(),v=_.hex(),E=this._plugin_background,R=T(A([m,f,b,1],E));t.style.color=R,t.style.backgroundColor=v}else t.style.backgroundColor="",t.style.color=""}import"chroma-js";function _e(e,t,r){let s=r.column_header?.[this._config.split_by.length],[o,l,i,n,a]=e?.color!==void 0?e.color:this._color;if(r._is_hidden_by_aggregate_depth)t.style.backgroundColor="",t.style.color="";else if(e?.datetime_color_mode==="foreground"&&r.user!==null)t.style.color=o,t.style.backgroundColor="";else if(e?.datetime_color_mode==="background"&&r.user!==null){let c=this._plugin_background,d=T(A([l,i,n,1],c));t.style.color=d,t.style.backgroundColor=o}else t.style.backgroundColor="",t.style.color=""}function he(e,t,r){if(r._is_hidden_by_aggregate_depth)t.style.backgroundColor="",t.style.color="";else{let[s]=r.user===!0?this._pos_fg_color:r.user===!1?this._neg_fg_color:["",0,0,0,""];t.style.backgroundColor="",t.style.color=s}}function ue(e,t,r){let s=typeof r.value!=null&&typeof r.value!=null&&r.value?.toString()?.trim().length>0,o=r.row_header_x>=this._config.group_by.length,l=e.getMeta({dx:0,dy:r.y-r.y0+1}),i=l&&l.row_header&&typeof l.row_header[r.row_header_x+1]<"u";t.classList.toggle("psp-tree-label",s&&!o),t.classList.toggle("psp-tree-label-expand",s&&!o&&!i),t.classList.toggle("psp-tree-label-collapse",s&&!o&&i),t.classList.toggle("psp-tree-leaf",s&&o)}function Ze(e){return e.x>=0?this._column_types[e.x]:this._row_header_types[e.row_header_x-1]}function ge(e,t){let r=e[k]||{},s=t.hasAttribute("settings");for(let o of e.children[0].children[1].children)for(let l of o.children){let i=e.getMeta(l),n=i.column_header?.[this._config.split_by.length],a=Ze.call(this,i),c=r[n],d=a==="integer"||a==="float";i._is_hidden_by_aggregate_depth=(h=>h===0?!1:h-1<Math.min(this._config.group_by.length,c?.aggregate_depth))(i.row_header?.filter(h=>h!==void 0)?.length),d?ce.call(this,c,l,i,s):a==="boolean"?he.call(this,c,l,i):a==="string"?pe.call(this,c,l,i):a==="date"||a==="datetime"?_e.call(this,c,l,i):(l.style.backgroundColor="",l.style.color=""),l.classList.toggle("psp-bool-type",a==="boolean"&&i.user!==null);let p=l.tagName==="TH";p&&ue.call(this,e,l,i),o.dataset.y=i.y,i.row_header_x===void 0||i.row_header_x===i.row_header.length-1||i.row_header[i.row_header_x+1]===void 0?(l.dataset.y=i.y,l.dataset.x=i.x):(delete l.dataset.y,delete l.dataset.x),l.classList.toggle("psp-null",i.value===null),l.classList.toggle("psp-align-right",!p&&d),l.classList.toggle("psp-align-left",p||!d),l.classList.toggle("psp-color-mode-bar",c?.number_fg_mode==="bar"&&d)}}async function me(e,t,r,s){let l=e.getMeta(s).column_header[this._config.split_by.length],i=r.ctrlKey||r.metaKet||r.altKey?Xe:Qe,n=r.shiftKey,a=i.call(this,l,n);await t.restore({sort:a})}function Xe(e,t){let r=[],s=!1;for(let o of this._config.sort){let[l,i]=o;if(l===e){s=!0;let n=be.call(this,e,i,t);n&&r.push(n)}else r.push(o)}return s||r.push([e,t?"desc abs":"desc"]),r}function Qe(e,t){for(let[r,s]of this._config.sort)if(r===e){let o=be.call(this,e,s,t);return o?[o]:[]}return[[e,t?"desc abs":"desc"]]}function be(e,t,r){let o=this._config.split_by.length>0?tt:et,l=t?o[t]:"desc";if(l)return[e,l]}var et={desc:"asc",asc:void 0,"desc abs":"asc abs","asc abs":void 0},tt={desc:"asc",asc:"col desc","desc abs":"asc abs","asc abs":"col desc abs","col desc":"col asc","col asc":void 0,"col desc abs":"col asc abs","col asc abs":void 0};async function fe(e,t){let r=e.getMeta(t.target),s=t.target.classList.contains("psp-tree-label-collapse");t.shiftKey&&s?this._view.set_depth(r.row_header.filter(o=>o!==void 0).length-2):t.shiftKey?this._view.set_depth(r.row_header.filter(o=>o!==void 0).length-1):s?this._view.collapse(r.y):this._view.expand(r.y),this._num_rows=await this._view.num_rows(),this._num_columns=await this._view.num_columns(),e.draw()}async function ye(e,t,r){if(r.which!==1)return;let s=r.target;if(s.tagName!=="A"){for(;s.tagName!=="TD"&&s.tagName!=="TH";)if(s=s.parentElement,!e.contains(s))return;if(s.classList.contains("psp-tree-label")){fe.call(this,e,r);return}if(s.classList.contains("psp-menu-enabled")){let l=e.getMeta(s).column_header?.[this._config.split_by.length];await t.toggleColumnSettings(l)}else s.classList.contains("psp-sort-enabled")&&me.call(this,e,t,r,s)}}function xe(e,t){if(t.which!==1)return;let r=t.target;for(;r.tagName!=="TD"&&r.tagName!=="TH";)if(r=r.parentElement,!e.contains(r))return;(r.classList.contains("psp-tree-label")&&t.offsetX<26||r.classList.contains("psp-header-leaf")&&!r.classList.contains("psp-header-corner"))&&t.stopImmediatePropagation()}function ve(e,t=!1){let r=this._config.group_by.length===0&&this._config.split_by.length===0,s=e.hasAttribute("selectable"),o=t||e.children[0]?.dataset?.editMode==="EDIT";return r&&!s&&o}function we(e,t,r){let s=e[k]||{},o=ve.call(this,t);r.classList.toggle("edit-mode-allowed",ve.call(this,t,!0));for(let l of e.querySelectorAll("td")){let i=e.getMeta(l),n=this.get_psp_type(i);if(o&&this._is_editable[i.x]){let a=i.column_header[this._config.split_by.length];n==="string"&&s[a]?.format==="link"?(l.toggleAttribute("contenteditable",!1),l.classList.toggle("boolean-editable",!1)):n==="boolean"?(l.toggleAttribute("contenteditable",!1),l.classList.toggle("boolean-editable",i.user!==null)):(o!==l.hasAttribute("contenteditable")&&l.toggleAttribute("contenteditable",o),l.classList.toggle("boolean-editable",!1))}else l.toggleAttribute("contenteditable",!1),l.classList.toggle("boolean-editable",!1)}}var G=(e,t,r)=>{let s=e.querySelectorAll("td"),o=r.get(e),l=e.getRootNode();if(o){for(let i of s){let n=e.getMeta(i);if(n.x===o.x&&n.y===o.y)return l.activeElement!==i&&i.focus({preventScroll:!0}),!0}document.activeElement!==document.body&&e.contains(l.activeElement)&&l.activeElement.blur()}};function Q(e,t,r){let s=e.getMeta(r),o=t._schema[t._column_paths[s.x]];if(s){let l=r.textContent,i=t._ids[s.y-s.y0][0];if(o==="float"||o==="integer"){if(l=parseFloat(l.replace(/,/g,"")),isNaN(l))return!1}else if(o==="date"||o==="datetime"){if(l=Date.parse(l),isNaN(l))return!1}else o==="boolean"&&(l=l==="true"?!1:l==="false"?!0:null);let n={__INDEX__:i,[t._column_paths[s.x]]:l};return t._table.update([n],{port_id:t._edit_port}),!0}}function ke(e,t,r){let s=e.getMeta(r.target);if(typeof s?.x<"u"){let o=this._is_editable[s.x],l=this.get_psp_type(s)==="boolean",i=r.target.classList.contains("psp-null");o&&l&&!i&&Q(e,this,r.target)}}function rt(e){let t;return async function(...r){if(t&&await t&&t)return;let s;t=new Promise(o=>s=o),await e.apply(this,r),t=void 0,s()}}function Ee(){if(this.isContentEditable){let e=this.getRootNode().getSelection().getRangeAt(0),t=e.cloneRange();return t.selectNodeContents(this),t.setEnd(e.endContainer,e.endOffset),t.toString().length}else return this.target.selectionStart}var I=rt(async function(e,t,r,s,o){let l=e.getMeta(r),i=this._column_paths.length,n=this._num_rows,a=t.get(e);if(!a)return;l.x+s<i&&0<=l.x+s&&(a.x=l.x+s),l.y+o<n&&0<=l.y+o&&(a.y=l.y+o);let c=Math.max(l.x0-10,0),d=Math.min(l.x0+10,i),p=Math.max(l.y0-5,0),h=Math.min(l.y0+10,n),u=l.x0+s,_=l.y0+o;for(;!G(e,void 0,t)&&u>=c&&u<d&&_>=p&&_<h;)await e.scrollToCell(u,_,i,n),t.set(e,a),u+=s,_+=o});function st(e,t,r){return t.getMeta(r).y===e._num_rows-1}function Le(e,t,r,s){let o=e.getRootNode().activeElement;switch(s.target.classList.remove("psp-error"),s.key){case"Enter":s.preventDefault(),st(this,e,o)?(o.blur(),r.delete(e)):s.shiftKey?I.call(this,e,r,o,0,-1):I.call(this,e,r,o,0,1);break;case"ArrowLeft":Ee.call(o)==0&&(s.preventDefault(),I.call(this,e,r,o,-1,0));break;case"ArrowUp":s.preventDefault(),I.call(this,e,r,o,0,-1);break;case"ArrowRight":Ee.call(o)==o.textContent.length&&(s.preventDefault(),I.call(this,e,r,o,1,0));break;case"ArrowDown":s.preventDefault(),I.call(this,e,r,o,0,1);break;default:}}function F(e,t=!1){let r=this._config.group_by.length===0&&this._config.split_by.length===0,s=e.hasAttribute("selectable"),o=t||e.children[0]._edit_mode==="EDIT";return r&&!s&&o}function Se(e,t,r,s){if(this._edit_mode==="EDIT"){if(!F.call(this,t))return;Le.call(this,e,t,r,s)}else console.debug(`Mode ${this._edit_mode} for "keydown" event not yet implemented`)}function Oe(e,t,r){if(this._edit_mode==="EDIT"){if(!F.call(this,t))return;ke.call(this,e,t,r)}else this._edit_mode==="READ_ONLY"||this._edit_mode==="SELECT_COLUMN"||this._edit_mode==="SELECT_ROW"||this._edit_mode==="SELECT_REGION"||console.debug(`Mode ${this._edit_mode} for "click" event not yet implemented`)}function Ce(e,t,r,s){if(F.call(this,t)&&r.has(e)){s.target.classList.remove("psp-error");let o=r.get(e);r.delete(e),o.content!==s.target.textContent&&(Q(e,this,s.target)||(s.target.textContent=o.content,s.target.classList.add("psp-error"),s.target.focus()))}}function Re(e,t,r,s){let o=e.getMeta(s.target);if(o){let l={x:o.x,y:o.y,content:s.target.textContent};r.set(e,l)}}async function U({_view:e,_config:t},r,s){let o=t.group_by,l=t.split_by,i=r>=0?r:0,n=i+1,a=await e.to_json({start_row:i,end_row:n}),d=a.map(b=>b.__ROW_PATH__)[0]||[],p=o.map((b,v)=>{let E=d[v];return E?[b,"==",E]:void 0}).filter(b=>b),h=o.length>0?s+1:s,u=Object.keys(a[0])[h],_={row:a[0]},m=[];if(u){let b=u.split("|");_.column_names=[b[l.length]],m=l.map((v,E)=>{let R=b[E];return R?[v,"==",R]:void 0}).filter(v=>v).filter(([,,v])=>v!=="__ROW_PATH__")}let f=t.filter.concat(p).concat(m);return _.config={filter:f},_}async function Me(e,t,r,s){let o=e.getMeta(s.target);if(!t.hasAttribute("selectable")||s.handled||s.which!==1||!o)return;let l=this._ids?.[o.y-o.y0];if(o&&o.y>=0){let i=r.get(e),n=!!i&&i.reduce((u,_,m)=>u&&_===l[m],!0),a=!!i&&l.length===i.length&&n,c={selected:!a},{row:d,column_names:p,config:h}=await U(this,o.y,o.x);a?(r.delete(e),c={...c,row:d,config:{filter:structuredClone(this._config.filter)}}):(r.set(e,l),c={...c,row:d,column_names:p,config:h}),await e.draw({preserve_width:!0}),s.handled=!0,t.dispatchEvent(new CustomEvent("perspective-select",{bubbles:!0,composed:!0,detail:c}))}}function Ne(e,t,r){if(!t.hasAttribute("selectable"))return;let s=r.has(e),o=r.get(e);for(let l of e.querySelectorAll("td"))if(!s)l.classList.toggle("psp-row-selected",!1),l.classList.toggle("psp-row-subselected",!1);else{let i=e.getMeta(l),n=this._ids[i.y-i.y0],a=o.reduce((c,d,p)=>c&&d===n[p],!0);l.classList.toggle("psp-row-selected",n.length===o.length&&a),l.classList.toggle("psp-row-subselected",n.length!==o.length&&a)}for(let l of e.querySelectorAll("tbody th")){let i=e.getMeta(l),n=this._ids[i.y-i.y0];if(!s||n[i.row_header_x])l.classList.toggle("psp-row-selected",!1),l.classList.toggle("psp-row-subselected",!1);else{let a=o.reduce((c,d,p)=>c&&d===n[p],!0);l.classList.toggle("psp-row-selected",n.length===o.length&&a),l.classList.toggle("psp-row-subselected",n.length!==o.length&&a)}}}async function Ae(e,t,r){r.delete(e);for(let s of e.querySelectorAll("td,th"))s.classList.toggle("psp-row-selected",!1),s.classList.toggle("psp-row-subselected",!1)}import nt from"chroma-js";var Te={datetime:Intl.DateTimeFormat,date:Intl.DateTimeFormat,integer:Intl.NumberFormat,float:Intl.NumberFormat,boolean:class{format(e){return e?"true":"false"}}},it={types:{float:{format:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}},datetime:{format:{dateStyle:"short",timeStyle:"medium"}},date:{format:{dateStyle:"short"}}}},H=class{constructor(){this._formatters=new Map}create_datetime_formatter(t,r){let s={dateStyle:"short",timeStyle:"medium"};if(r.date_format?.format!=="custom"){let o={...s,timeZone:r.date_format?.timeZone,dateStyle:r.date_format?.dateStyle,timeStyle:r.date_format?.timeStyle};return o.dateStyle==="disabled"?o.dateStyle=void 0:o.dateStyle===void 0&&(o.dateStyle="short"),o.timeStyle==="disabled"?o.timeStyle=void 0:o.timeStyle===void 0&&(o.timeStyle="medium"),new Intl.DateTimeFormat(navigator.languages,o)}else{let o={timeZone:r.date_format?.timeZone,second:r.date_format?.second,minute:r.date_format?.minute,hour:r.date_format?.hour,day:r.date_format?.day,weekday:r.date_format?.weekday,month:r.date_format?.month,year:r.date_format?.year,hour12:r.date_format?.hour12,fractionalSecondDigits:r.date_format?.fractionalSecondDigits};return o.year==="disabled"?o.year=void 0:o.year===void 0&&(o.year="2-digit"),o.month==="disabled"?o.month=void 0:o.month===void 0&&(o.month="numeric"),o.day==="disabled"?o.day=void 0:o.day===void 0&&(o.day="numeric"),o.weekday==="disabled"&&(o.weekday=void 0),o.hour==="disabled"?o.hour=void 0:o.hour===void 0&&(o.hour="numeric"),o.minute==="disabled"?o.minute=void 0:o.minute===void 0&&(o.minute="numeric"),o.second==="disabled"?o.second=void 0:o.second===void 0&&(o.second="numeric"),o.hour12===void 0&&(o.hour12=!0),new Intl.DateTimeFormat(navigator.languages,o)}}create_date_formatter(t,r){let s={dateStyle:r.date_format?.dateStyle,timeZone:"utc"};return s.dateStyle==="disabled"?s.dateStyle=void 0:s.dateStyle===void 0&&(s.dateStyle="short"),new Intl.DateTimeFormat(navigator.languages,s)}create_number_formatter(t,r){let s=it.types[t]?.format;return r.number_format!==void 0&&(s=r.number_format),new Te[t](navigator.languages,s)}create_boolean_formatter(t,r){return new Te[t](navigator.languages,{})}get(t,r){let s=[t,...Object.values(r.date_format??{}),...Object.values(r.number_format??{})].join("-");return this._formatters.has(s)||(t==="date"?this._formatters.set(s,this.create_date_formatter(t,r)):t==="datetime"?this._formatters.set(s,this.create_datetime_formatter(t,r)):t==="integer"||t==="float"?this._formatters.set(s,this.create_number_formatter(t,r)):t==="boolean"?this._formatters.set(s,this.create_boolean_formatter(t,r)):this._formatters.set(s,!1)),this._formatters.get(s)}};var ze=new H,De=1;function Ie(e,t){return ze.get(e,t)}function P(e,t,r={},s=!1){if(t===null)return null;let o=s&&this._table_schema[e]||this._schema[e]||"string",l=r[e]||{};if((o==="integer"||o==="float")&&l?.number_fg_mode==="bar"){let n=Math.max(0,Math.min(De,Math.abs(t/l.fg_gradient)*De)),a=this._div_factory.get(),c=t>=0?"left":"right",d=(n*100).toFixed(2);return a.setAttribute("style",`width:calc(${d}% - 4px);position:absolute;${c}:2px;height:80%;top:10%;pointer-events:none;`),a}else if(l?.format==="link"&&o==="string"){let n=document.createElement("a");return n.setAttribute("href",t),n.setAttribute("target","_blank"),n.textContent=t,n}else if(l?.format==="bold"&&o==="string"){let n=document.createElement("b");return n.textContent=t,n}else if(l?.format==="italics"&&o==="string"){let n=document.createElement("i");return n.textContent=t,n}else{let n=ze.get(o,l);return n?n.format(t):t}}function*Ue(e=[],t,r){let s=r[k];for(let o of e){o=["TOTAL",...o];let l=o[o.length-1];o=o.slice(0,o.length-1).fill("");let i=P.call(this,t[o.length-1],l,s,!0);i instanceof HTMLElement?o=o.concat(i):o=o.concat({toString:()=>i}),o.length=t.length+1,yield o}}function*Pe(e=[],t,r){let s=r[k];for(let o of e){let l=[""];for(let i in o)l.push(P.call(this,t[i],o[i],s,!0));yield o}}function We(e){let t,r,s,o,l;return async function(n,a,c,d,p){let h={},u={start_row:c,start_col:a,end_row:p,end_col:d,id:!0},_=null;if(d-a>0&&p-c>0){this._is_old_viewport=this._last_window?.start_row===c&&this._last_window?.end_row===p&&this._last_window?.start_col===a&&this._last_window?.end_col===d;let[L,D]=await Promise.all([this._view.to_columns_string(u),this._view.num_columns()]);_=D,h=JSON.parse(L);let S=Object.keys(h).filter(x=>x!=="__ROW_PATH__"&&x!=="__ID__"),N=this._column_paths.length;if(this._column_paths.splice(u.start_col,S.length,...S),this._column_paths.length!==N||N===0){let[x,g]=await Promise.all([this._view.schema(),this._view.expression_schema()]);this._schema={...x,...g};for(let w=0;w<S.length;w++){let re=S[w].split("|")[this._config.split_by.length];this._is_editable[w+u.start_col]=!!this._table_schema[re],this._column_types[w+u.start_col]=this._schema[re]}}this._last_window=u,this._ids=h.__ID__||Array(p-c).fill().map((x,g)=>[g+c]),this._reverse_columns=this._column_paths.slice(a,d).reduce((x,g,w)=>(x.set(g,w),x),new Map),this._reverse_ids=this._ids?.reduce((x,g,w)=>(x.set(g?.join("|"),w),x),new Map)}else this._div_factory.clear(),_=await this._view.num_columns();let m=[],f=[],b=[],v=[],E=e.hasAttribute("settings");for(let L=a;L<Math.min(d,this._column_paths.length);++L){let D=this._column_paths[L],C=D.split("|"),S=h[D]||new Array(p-c).fill(null),N=Math.min(n[k]?.[C[this._config.split_by.length]]?.aggregate_depth||0,this._config.group_by.length);m.push(S.map((x,g)=>h?.__ROW_PATH__?.[g]?.length<N?"":P.call(this,C[this._config.split_by.length],x,n[k]))),f.push(S),E&&C.push(""),b.push(C),v.push(D)}d-a>0&&p-c>0&&(this.last_column_paths=r,this.last_meta=t,this.last_ids=s,this.last_reverse_ids=o,this.last_reverse_columns=l,r=v,t=f,s=this._ids,o=this._reverse_ids,l=this._reverse_columns);let R=h.__ROW_PATH__!==void 0,M=Array.from((R?Ue:Pe).call(this,h.__ROW_PATH__,this._config.group_by,n)),z=M[0]?.length;return{num_column_headers:b[0]?.length||1,num_row_headers:z,num_rows:this._num_rows,num_columns:_,row_headers:M,column_headers:b,data:m,metadata:f,column_header_merge_depth:Math.max(0,this._config.split_by.length)}}}function j(e,t,r){let s=window.getComputedStyle(e).getPropertyValue(t).trim();return s.length>0?s:r}var ee=class{constructor(t){this._name=t,this._elements=[],this._index=0}clear(){this._index=0}get(){this._elements[this._index]||(this._elements[this._index]=document.createElement(this._name));let t=this._elements[this._index];return this._index+=1,t}};function at(e){return e.x>=0?this._column_types[e.x]:this._row_header_types[e.row_header_x-1]}async function te(e,t,r,s={}){let o=await r.get_config();if(this?.model?._config){let y=this.model._config,L=y.group_by.length!==o.group_by.length,D=(y.group_by.length===0||o.group_by.length===0)&&L;if(!L)for(let g in y.group_by)L||=o.group_by[g]!==y.group_by[g];let C=y.split_by.length!==o.split_by.length;if(C)for(let g in y.split_by)C||=o.split_by[g]!==y.split_by[g];let S=y.columns.length!==o.columns.length;if(S)for(let g in y.columns)S||=o.columns[g]!==y.columns[g];let N=y.filter.length!==o.filter.length;if(N)for(let g in y.filter)for(let w in o.filter[g])N||=o.filter[g][w]!==y.filter[g][w];let x=y.sort.length!==o.sort.length;if(x)for(let g in y.sort)for(let w in o.sort[g])x||=o.sort[g][w]!==y.sort[g][w];this._reset_scroll_top=L,this._reset_scroll_left=C,this._reset_select=L||C||N||x||S,this._reset_column_size=C||L||S||D}let[l,i,n,a,c]=await Promise.all([t.schema(),r.num_rows(),r.schema(),r.expression_schema(),this.parentElement.getEditPort()]),d=nt(j(e,"--plugin--background","#FFFFFF")).rgb(),p=O(j(e,"--rt-pos-cell--color","#338DCD")),h=O(j(e,"--rt-neg-cell--color","#FF5942")),u=O(X(p[0],d)),_=O(X(h[0],d)),m=O(j(e,"--active--color","#ff0000")),f={...n,...a},b={...l,...a},v=[],E=[],R=[],M=this._edit_mode||"READ_ONLY";this._edit_button.dataset.editMode=M;let z=Object.assign(s,{_edit_port:c,_view:r,_table:t,_table_schema:b,_config:o,_num_rows:i,_schema:f,_ids:[],_plugin_background:d,_color:m,_pos_fg_color:p,_neg_fg_color:h,_pos_bg_color:u,_neg_bg_color:_,_column_paths:v,_column_types:R,_is_editable:E,_edit_mode:M,_selection_state:{selected_areas:[],dirty:!1},_row_header_types:o.group_by.map(y=>b[y]),_series_color_map:new Map,_series_color_seed:new Map,get_psp_type:at});return z._div_factory=z._div_factory||new ee("div"),e.setDataListener(We(this.parentElement).bind(z,e),{virtual_mode:window.getComputedStyle(e).getPropertyValue("--datagrid-virtual-mode")?.trim()||"both"}),z}async function $e(e,t,r){let s=e.getMeta(r.target);if(!s)return;let{x:o,y:l}=s,{row:i,column_names:n,config:a}=await U(this,l,o);t.dispatchEvent(new CustomEvent("perspective-click",{bubbles:!0,composed:!0,detail:{row:i,column_names:n,config:a}}))}var ct="mouse-selected-area",Ge=(e,t,{className:r=ct,selected:s=[]}={})=>(e.model._selection_state={selected_areas:s,dirty:!0},t.addEventListener("mousedown",dt(e,t,r)),t.addEventListener("mouseover",pt(e,t,r)),t.addEventListener("mouseup",_t(e,t,r)),t.addStyleListener(()=>W(e,t,r)),t),dt=(e,t,r)=>s=>{if(s.button===0&&(e.model._edit_mode==="SELECT_REGION"||e.model._edit_mode==="SELECT_ROW"||e.model._edit_mode==="SELECT_COLUMN")){e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES={};let o=t.getMeta(s.target);if(o&&o.x!==void 0&&o.y!==void 0){e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES={x:o.x,y:o.y},e.model._selection_state.old_selected_areas=e.model._selection_state.selected_areas,e.model._selection_state.selected_areas=[];let l={x0:o.x,x1:o.x,y0:o.y,y1:o.y};e.model._selection_state.potential_selection=l,W(e,t,r,e.model._selection_state.selected_areas.concat([l]));return}}e.model._selection_state.selected_areas=[]},pt=(e,t,r)=>s=>{if((e.model._edit_mode==="SELECT_REGION"||e.model._edit_mode==="SELECT_ROW"||e.model._edit_mode==="SELECT_COLUMN")&&e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES&&e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x!==void 0){let o=t.getMeta(s.target);if(o&&o.x!==void 0&&o.y!==void 0){let l={x0:Math.min(o.x,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x),x1:Math.max(o.x,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x),y0:Math.min(o.y,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.y),y1:Math.max(o.y,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.y)};e.model._selection_state.potential_selection=l,W(e,t,r,e.model._selection_state.selected_areas.concat([l]))}}},_t=(e,t,r)=>s=>{if(e.model._edit_mode==="SELECT_REGION"||e.model._edit_mode==="SELECT_ROW"||e.model._edit_mode==="SELECT_COLUMN"){let o=t.getMeta(s.target);if(e.model._selection_state.old_selected_areas?.length>0){let l=e.model._selection_state.old_selected_areas[0];if(l.x0===l.x1&&l.y0===l.y1&&l.x0===o.x&&l.y0===o.y){e.model._selection_state.selected_areas=[],e.model._selection_state.old_selected_areas=[],e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES={},e.model._selection_state.potential_selection=void 0,W(e,t,r,[]);return}}if(e.model._selection_state.old_selected_areas=[],e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES&&e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x!==void 0&&o.x!==void 0&&o.y!==void 0){let l={x0:Math.min(o.x,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x),x1:Math.max(o.x,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x),y0:Math.min(o.y,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.y),y1:Math.max(o.y,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.y)};e.model._selection_state.selected_areas.push(l),W(e,t,r)}e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES={},e.model._selection_state.potential_selection=void 0}};function ht(e,t,{x0:r,x1:s,y0:o,y1:l}){let i={},n=t.model._edit_mode;r!==void 0&&["SELECT_COLUMN","SELECT_REGION"].indexOf(n)>-1&&(i.start_col=r),s!==void 0&&["SELECT_COLUMN","SELECT_REGION"].indexOf(n)>-1&&(i.end_col=s+1),o!==void 0&&["SELECT_ROW","SELECT_REGION"].indexOf(n)>-1&&(i.start_row=o),l!==void 0&&["SELECT_ROW","SELECT_REGION"].indexOf(n)>-1&&(i.end_row=l+1),e.setSelection(i)}var W=(e,t,r,s)=>{if(e.model._edit_mode==="SELECT_REGION"||e.model._edit_mode==="SELECT_ROW"||e.model._edit_mode==="SELECT_COLUMN"){s=e.model._selection_state.selected_areas.slice(0),e.model._selection_state.potential_selection&&s.push(e.model._selection_state.potential_selection);let o=t.querySelectorAll("tbody td");if(s.length>0)ht(e.parentElement,e,s[0]),ut(e,t,s,r);else{e.parentElement.setSelection();for(let l of o)l.classList.remove(r)}}else if(e.model._selection_state.dirty){e.model._selection_state.dirty=!1;let o=t.querySelectorAll("tbody td");for(let l of o)l.classList.remove(r)}},ut=(e,t,r,s)=>{if(e.model._edit_mode==="SELECT_REGION"&&r.length>0){let o=t.querySelectorAll("tbody td");for(let l of o){let i=t.getMeta(l),n=!1;for(let{x0:a,x1:c,y0:d,y1:p}of r)a!==void 0&&d!==void 0&&c!==void 0&&p!==void 0&&a<=i.x&&i.x<=c&&d<=i.y&&i.y<=p&&(n=!0,e.model._selection_state.dirty=!0,l.classList.add(s));n||l.classList.remove(s)}}else if(e.model._edit_mode==="SELECT_ROW"&&r.length>0){let o=t.querySelectorAll("tbody td");for(let l of o){let i=t.getMeta(l),n=!1;for(let{x0:a,x1:c,y0:d,y1:p}of r)a!==void 0&&d!==void 0&&c!==void 0&&p!==void 0&&d<=i.y&&i.y<=p&&(e.model._selection_state.dirty=!0,n=!0,l.classList.add(s));n||l.classList.remove(s)}}else if(e.model._edit_mode==="SELECT_COLUMN"&&r.length>0){let o=t.querySelectorAll("tbody td");for(let l of o){let i=t.getMeta(l),n=!1;for(let{x0:a,x1:c,y0:d,y1:p}of r)a!==void 0&&d!==void 0&&c!==void 0&&p!==void 0&&a<=i.x&&i.x<=c&&(e.model._selection_state.dirty=!0,n=!0,l.classList.add(s));n||l.classList.remove(s)}}};async function Fe(e){let t=this.parentElement,r=await t.getTable(!0);if(this._initialized)await te.call(this,this.regular_table,r,e,this.model);else{if(this.innerHTML="",this.shadowRoot?this.shadowRoot.appendChild(this.regular_table):this.appendChild(this.regular_table),this.model=await te.call(this,this.regular_table,r,e),!this.model)return;Ge(this,this.regular_table,{className:"psp-select-region"}),this.regular_table.addStyleListener(ge.bind(this.model,this.regular_table,t)),this.regular_table.addStyleListener(ie.bind(this.model,this.regular_table)),this.regular_table.addStyleListener(le.bind(this.model,this.regular_table,t)),this.regular_table.addEventListener("click",xe.bind(this.model,this.regular_table)),this.regular_table.addEventListener("mousedown",ye.bind(this.model,this.regular_table,t));let s=new WeakMap;this.regular_table.addStyleListener(Ne.bind(this.model,this.regular_table,t,s)),this.regular_table.addEventListener("mousedown",Me.bind(this.model,this.regular_table,t,s)),this.regular_table.addEventListener("psp-deselect-all",Ae.bind(this.model,this.regular_table,t,s)),this.regular_table.addEventListener("click",$e.bind(this.model,this.regular_table,t));let o=new WeakMap;this.regular_table.addStyleListener(we.bind(this.model,this.regular_table,t,this)),this.regular_table.addStyleListener(G.bind(this.model,this.regular_table,t,o)),this.regular_table.addEventListener("click",Oe.bind(this.model,this.regular_table,t)),this.regular_table.addEventListener("focusin",Re.bind(this.model,this.regular_table,t,o)),this.regular_table.addEventListener("focusout",Ce.bind(this.model,this.regular_table,t,o)),this.regular_table.addEventListener("keydown",Se.bind(this.model,this.regular_table,t,o)),t.addEventListener("perspective-toggle-column-settings",l=>{if(this.isConnected){if(Z.call(this.model,this.regular_table,t,l.detail.column_name),!l.detail.open){this.model._column_settings_selected_column=null;return}this.model._column_settings_selected_column=l.detail.column_name}}),this._initialized=!0}}function Y(e,t=!1){if(!this._initialized)return;t&&(this._cached_column_sizes=e);let r={},{group_by:s,columns:o}=this.model._config,l=s?.length>0?s.length+1:0;for(let i of Object.keys(e))if(i==="__ROW_PATH__")r[l-1]=e[i];else{let n=this.model._column_paths.indexOf(i);r[n+l]=e[i]}this.regular_table._column_sizes.override=r}function q(){if(!this._initialized)return[];if(this._cached_column_sizes){let l=this._cached_column_sizes;return this._cached_column_sizes=void 0,l}let e=this.regular_table._column_sizes.override,{group_by:t,columns:r}=this.model._config,s=t?.length>0?t.length+1:0,o={};for(let l of Object.keys(e))if(e[l]!==void 0){let i=l-s;i>-1?o[this.model._column_paths[i]]=e[l]:i===-1&&(o.__ROW_PATH__=e[l])}return o}var $=["READ_ONLY","EDIT","SELECT_ROW","SELECT_COLUMN","SELECT_REGION"];function B(e=void 0){typeof e>"u"&&(e=$[($.indexOf(this._edit_mode)+1)%$.length]),this.parentElement?.setSelection(),this._edit_mode=e,this.model&&(this.model._edit_mode=e,this.model._selection_state={selected_areas:[],dirty:!0}),this._edit_button!==void 0&&(this._edit_button.dataset.editMode=e),this.dataset.editMode=e}function V(e=void 0){typeof e>"u"&&(e=!this._is_scroll_lock),this._is_scroll_lock=e,this.classList.toggle("sub-cell-scroll-disabled",e),this._scroll_lock!==void 0&&this._scroll_lock.classList.toggle("lock-scroll",e)}function He(e,t){e=JSON.parse(JSON.stringify(e)),t=JSON.parse(JSON.stringify(t));let r={};if(e.columns)for(let[l,i]of Object.entries(e.columns))i.column_size_override!==void 0&&(r[l]=i.column_size_override,delete i.column_size_override);let s={};if(t)for(let[l,i]of Object.entries(t))s[l]={...i,pos_fg_color:i.pos_fg_color?O(i.pos_fg_color):void 0,neg_fg_color:i.neg_fg_color?O(i.neg_fg_color):void 0,pos_bg_color:i.pos_bg_color?O(i.pos_bg_color):void 0,neg_bg_color:i.neg_bg_color?O(i.neg_bg_color):void 0,color:i.color?O(i.color):void 0};"edit_mode"in e&&($.indexOf(e.edit_mode)!==-1?B.call(this,e.edit_mode):console.error("Unknown edit mode "+e.edit_mode)),"scroll_lock"in e&&V.call(this,e.scroll_lock);let o=this.regular_table;Y.call(this,r,!0),o[k]=s}function je(){if(this.regular_table){let e={columns:{},scroll_lock:!!this._is_scroll_lock,edit_mode:this._edit_mode},t=q.call(this);for(let r of Object.keys(t||{}))e.columns[r]||(e.columns[r]={}),e.columns[r].column_size_override=t[r];return JSON.parse(JSON.stringify(e))}return{}}async function Ye(e){if(this.parentElement&&await this.activate(e),!this.isConnected||this.offsetParent==null||!this.model)return;let t=q.call(this),r=this.regular_table.draw({invalid_columns:!0});this._reset_scroll_top&&(this.regular_table.scrollTop=0,this._reset_scroll_top=!1),this._reset_scroll_left&&(this.regular_table.scrollLeft=0,this._reset_scroll_left=!1),this._reset_select&&(this.regular_table.dispatchEvent(new CustomEvent("psp-deselect-all",{bubbles:!1})),this._reset_select=!1),this._reset_column_size&&(this.regular_table._resetAutoSize(),this._reset_column_size=!1),Y.call(this,t),await r,this._toolbar.classList.toggle("aggregated",this.model._config.group_by.length>0||this.model._config.split_by.length>0)}function oe(e,t){return e==="integer"||e==="float"?{datagrid_number_style:{fg_gradient:0,pos_fg_color:this.model._pos_fg_color[0],neg_fg_color:this.model._neg_fg_color[0],number_fg_mode:"color",bg_gradient:0,pos_bg_color:this.model._pos_bg_color[0],neg_bg_color:this.model._neg_bg_color[0],number_bg_mode:"disabled"},number_string_format:!0}:e==="date"||e==="datetime"||e==="string"?{[e==="date"||e==="datetime"?"datagrid_datetime_style":"datagrid_string_style"]:{color:this.model._color[0],bg_color:this.model._color[0]}}:null}var qe='regular-table{padding:0;margin:12px 0 0 12px;font-family:inherit;--rt-hover--border-color:var(--inactive--color,#c5c9d080);}regular-table div[tabindex]{outline:none;}regular-table>div{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;}regular-table th{text-align:center;}regular-table thead tr:not(.rt-autosize) th{overflow:hidden;max-width:0px;}regular-table thead tr:last-child .rt-float,regular-table tbody .rt-float{text-align:right;}regular-table thead .rt-integer,regular-table tbody .rt-integer{text-align:right;}regular-table tbody th{text-align:left;}regular-table span.rt-tree-container{display:flex;align-items:center;height:100%;}regular-table thead .rt-string,regular-table tbody .rt-string,regular-table thead .rt-date,regular-table tbody .rt-date,regular-table thead .rt-datetime,regular-table tbody .rt-datetime{text-align:left;}regular-table thead tr:last-child th{border-bottom:1px solid#8b868045;}regular-table tbody tr:first-child td,regular-table tbody tr:first-child th{border-top:1px solid transparent!important;}regular-table th{position:relative;}regular-table tr th span.rt-tree-group{margin-left:5px;margin-right:15px;border-left:1px solid#eee;height:100%;}regular-table td,regular-table th{white-space:nowrap;font-size:12px;padding-right:5px;padding-left:5px;padding-top:0px;padding-bottom:0px;height:19px;}regular-table table *{box-sizing:border-box;}regular-table table{position:absolute;color:#666;outline:none;}regular-table span.rt-row-header-icon{color:#aaa;padding-right:4px;font-family:var(--button--font-family);}regular-table span.rt-column-header-icon{font-size:10px;padding-left:3px;display:inline-block;width:10px;font-family:var(--button--font-family);}regular-table span.rt-row-header-icon:hover{color:#1a7da1;text-shadow:0px 0px 3px#1a7da1;}regular-table .rt-selected td{background-color:#eee;}regular-table .rt-cell-clip{overflow:hidden;text-overflow:ellipsis;}regular-table td span.rt-group-name,regular-table th span.rt-group-name{margin-right:-5px;padding-right:5px;padding-left:8px;flex:1;height:100%;}regular-table th span.rt-group-name{text-align:left;}regular-table td th span.rt-group-leaf,regular-table th span.rt-group-leaf{margin-left:16px;height:100%;}regular-table .rt-column-resize{height:100%;width:10px;position:absolute;top:0;right:0;cursor:col-resize;}regular-table a{color:var(--rt-pos-cell--color);}regular-table a:visited{color:var(--active--color);}regular-table td.psp-null:after,regular-table th.psp-null:after{content:var(--null--content,"-");}.psp-header-border:not(.psp-is-top):not(.psp-header-leaf){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}.psp-header-group{box-shadow:0px 10px 0 -9px var(--inactive--border-color,#8b868045);}.psp-is-top{box-shadow:5px 4px 0px -4px var(--inactive--border-color,#8b868045);}.psp-is-top.psp-header-group:not(.psp-header-group-corner){box-shadow:5px 4px 0px -4px var(--inactive--border-color,#8b868045),0px 10px 0 -9px var(--inactive--border-color,#8b868045);}.psp-header-border.psp-header-group:not(.psp-is-top):not(.psp-header-group-corner){box-shadow:1px 0px var(--inactive--border-color,#8b868045),0px 10px 0 -9px var(--inactive--border-color,#8b868045);}perspective-viewer[settings] tr.rt-autosize .psp-header-leaf.psp-header-border:not(.psp-menu-enabled){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}:host-context(perspective-viewer[settings]) tr.rt-autosize .psp-header-leaf.psp-header-border:not(.psp-menu-enabled){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}.psp-header-leaf.psp-header-border{box-shadow:5px -4px 0px -4px var(--inactive--border-color,#8b868045);}tr:only-child th{box-shadow:none!important;}regular-table tbody tr:hover th.psp-tree-leaf:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover th.psp-tree-label:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover td:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover:after{border-color:var(--rt-hover--border-color,#c5c9d080)!important;box-shadow:0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:hover th.psp-tree-leaf.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover th.psp-tree-label.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover td.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr.psp-menu-open:hover:after{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:last-child:hover td.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected){box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),inset 0px -2px 0px var(--icon--color),0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:hover+tr th.psp-tree-leaf:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover+tr th.psp-tree-label:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover+tr td:not(.psp-row-selected):not(.psp-row-subselected){border-top-color:transparent;}regular-table tbody tr th:first-child:not(:empty),regular-table tbody tr th:first-child:empty+th:not(:empty),regular-table tbody tr th:first-child:empty~th:empty+th:not(:empty),regular-table tbody tr td:first-child{border-left-width:1px;border-left-color:transparent;}regular-table tbody tr th:last-child,regular-table tbody tr td:last-child{border-right-width:0px;border-right-color:transparent;}regular-table tbody tr:hover{color:inherit;}regular-table tbody tr:hover th:first-child:not(:empty),regular-table tbody tr:hover th:first-child:empty+th:not(:empty),regular-table tbody tr:hover th:first-child:empty~th:empty+th:not(:empty),regular-table tbody tr:hover td:first-child{border-left-color:var(--rt-hover--border-color,#c5c9d080)!important;}regular-table tbody tr:hover th:last-child,regular-table tbody tr:hover td:last-child{border-right-color:var(--rt-hover--border-color,#c5c9d080)!important;}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody td,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead th:not(.rt-group-corner),:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody td,:host(:not(.sub-cell-scroll-disabled)) regular-table table thead th:not(.rt-group-corner){transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody{transform:translate(0,var(--regular-table--transform-y,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child td,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child th,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child td,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child th,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child:after{clip-path:polygon(0 var(--regular-table--clip-y,0),0 200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr td:first-of-type,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr td:first-of-type{clip-path:polygon(var(--regular-table--clip-x,0) 0,var(--regular-table--clip-x,0) 200%,200% 200%,200% 0);}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child td:first-of-type,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child td:first-of-type{clip-path:polygon(var(--regular-table--clip-x,0) var(--regular-table--clip-y,0),var(--regular-table--clip-x,0) 200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead tr:last-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table thead tr:last-child:after{transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:not(:first-child):after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:not(:first-child):after{transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:hover:first-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:hover:first-child:after{clip-path:polygon(0 var(--regular-table--clip-y,0),0 200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead tr th.rt-group-corner+th:not(.rt-group-corner),:host(:not(.sub-cell-scroll-disabled)) regular-table table thead tr th.rt-group-corner+th:not(.rt-group-corner){clip-path:polygon(var(--regular-table--clip-x,0) 0,var(--regular-table--clip-x,0) 200%,200% 200%,200% 0);}regular-table{outline:none;}regular-table::-webkit-scrollbar,regular-table::-webkit-scrollbar-corner{background-color:transparent;height:12px;width:12px;}regular-table::-webkit-scrollbar-thumb{background-clip:content-box;background:var(--icon--color);border:5.5px solid var(--plugin--background);max-height:50%;max-width:50%;min-width:10%;min-height:10%;}perspective-viewer:not([settings]) regular-table table tr.rt-autosize+tr th{height:0px;}perspective-viewer:not([settings]) regular-table table tr.rt-autosize+tr th span{display:none;}:host-context(perspective-viewer:not([settings])) regular-table table tr.rt-autosize+tr th{height:0px;}:host-context(perspective-viewer:not([settings])) regular-table table tr.rt-autosize+tr th span{display:none;}perspective-viewer[settings] .psp-menu-enabled{padding:0 6px;font-size:8px;border-radius:3px 3px 0 0;}perspective-viewer[settings] .psp-menu-enabled:hover,perspective-viewer[settings] tr:not(.rt-autosize) th.psp-menu-open{color:var(--plugin--background);background-color:var(--icon--color);border-bottom-color:var(--icon--color);cursor:pointer;}perspective-viewer[settings] tr:not(.rt-autosize) th.psp-menu-open:before{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;height:8px;width:10px;-webkit-mask-image:var(--column-settings-icon--mask-image);mask-image:var(--column-settings-icon--mask-image);margin-right:4px;background-color:var(--plugin--background);}perspective-viewer[settings] td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color);}perspective-viewer[settings] tr:first-child td.psp-menu-open{border-top-color:var(--icon--color)!important;}perspective-viewer[settings] tr:last-child td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),inset 0px -2px 0px var(--icon--color);}:host-context(perspective-viewer[settings]) .psp-menu-enabled{padding:0 6px;font-size:8px;border-radius:3px 3px 0 0;}:host-context(perspective-viewer[settings]) .psp-menu-enabled:hover,:host-context(perspective-viewer[settings]) tr:not(.rt-autosize) th.psp-menu-open{color:var(--plugin--background);background-color:var(--icon--color);border-bottom-color:var(--icon--color);cursor:pointer;}:host-context(perspective-viewer[settings]) tr:not(.rt-autosize) th.psp-menu-open:before{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;height:8px;width:10px;-webkit-mask-image:var(--column-settings-icon--mask-image);mask-image:var(--column-settings-icon--mask-image);margin-right:4px;background-color:var(--plugin--background);}:host-context(perspective-viewer[settings]) td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color);}:host-context(perspective-viewer[settings]) tr:first-child td.psp-menu-open{border-top-color:var(--icon--color)!important;}:host-context(perspective-viewer[settings]) tr:last-child td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),inset 0px -2px 0px var(--icon--color);}perspective-viewer regular-table table thead tr:last-child th{border-bottom-width:1px;border-bottom-color:var(--inactive--border-color,#8b868045);}:host-context(perspective-viewer) regular-table table thead tr:last-child th{border-bottom-width:1px;border-bottom-color:var(--inactive--border-color,#8b868045);}.psp-sort-enabled:hover{cursor:pointer;}.psp-row-selected,:hover .psp-row-selected,:hover th.psp-tree-leaf.psp-row-selected,:hover th.psp-tree-label.psp-row-selected{color:white!important;background-color:var(--selected-row--background-color,#ea7319)!important;border-color:var(--selected-row--background-color,#ea7319)!important;}.psp-row-selected.psp-tree-label:not(:hover):before{color:white;}.psp-row-subselected,:hover .psp-row-subselected,:hover th.psp-tree-leaf.psp-row-subselected,:hover th.psp-tree-label.psp-row-subselected{background:rgba(234,115,25,0.2)!important;}.psp-error{color:red;}td:focus{outline:#666;outline-style:dotted;outline-width:1px;}perspective-viewer.dragging regular-table{pointer-events:none;}:host-context(perspective-viewer.dragging) regular-table{pointer-events:none;}.psp-header-border:last-child{border-right-width:0px;}.psp-header-sort-desc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-desc-icon--mask-image);mask-image:var(--sort-desc-icon--mask-image);}.psp-header-sort-asc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-asc-icon--mask-image);mask-image:var(--sort-asc-icon--mask-image);}.psp-header-sort-col-desc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-col-desc-icon--mask-image);mask-image:var(--sort-col-desc-icon--mask-image);}.psp-header-sort-col-asc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-col-asc-icon--mask-image);mask-image:var(--sort-col-asc-icon--mask-image);}.psp-header-sort-abs-desc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-abs-desc-icon--mask-image);mask-image:var(--sort-abs-desc-icon--mask-image);}.psp-header-sort-abs-asc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-abs-asc-icon--mask-image);mask-image:var(--sort-abs-asc-icon--mask-image);}.psp-header-sort-abs-col-desc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-abs-col-desc-icon--mask-image);mask-image:var(--sort-abs-col-desc-icon--mask-image);}.psp-header-sort-abs-col-asc:after{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;width:14px;height:11px;margin-left:4px;-webkit-mask-image:var(--sort-abs-col-asc-icon--mask-image);mask-image:var(--sort-abs-col-asc-icon--mask-image);}tbody th:last-of-type{border-right:1px solid var(--inactive--border-color,#8b868045);overflow:hidden;text-overflow:ellipsis;}tbody th:empty{background-image:linear-gradient(to right,transparent 9px,var(--inactive--border-color,#eee) 10px,transparent 11px);background-repeat:no-repeat;min-width:20px;max-width:20px;pointer-events:none;}.psp-tree-label{max-width:0px;min-width:0px;}.psp-tree-label:before{color:var(--icon--color);font-family:var(--button--font-family,inherit);padding-right:11px;}.psp-tree-label-expand:before{content:var(--tree-label-expand--content,"+");}.psp-tree-label-collapse:before{content:var(--tree-label-collapse--content,"-");}.psp-tree-label-expand,.psp-tree-label-collapse{cursor:pointer;}.psp-tree-label:hover:before{color:var(--active--color);text-shadow:0px 0px 5px var(--active--color);}.psp-tree-leaf{padding-left:24px;}.psp-align-right{text-align:right;}.psp-align-left{text-align:left;}.psp-positive:not(:focus){color:var(--rt-pos-cell--color);}.psp-negative:not(:focus){color:var(--rt-neg-cell--color);}regular-table table tbody td{min-width:52px!important;}.psp-is-width-override .rt-column-resize,.rt-column-resize:hover{border:1px dashed#999;border-bottom-width:0px;border-left-width:0px;}.boolean-editable{cursor:pointer;}regular-table table{user-select:none;color:inherit;border-collapse:separate;}regular-table table th{font-weight:400;}regular-table table td,regular-table table th{border-color:var(--inactive--border-color,#8b868045);height:23px;}regular-table table .psp-header-group{text-overflow:ellipsis;}regular-table table th.psp-header-leaf{border-bottom-width:0px;}regular-table table th.psp-header-leaf span{height:23px;min-height:23px;}regular-table table td,regular-table table th.psp-tree-label,regular-table table th.psp-tree-label,regular-table table th.psp-tree-leaf,regular-table table tbody tr:first-child th{border-style:solid;border-width:0px;border-top-width:1px;}regular-table table tbody th:empty{background-position:0px -10px;}regular-table table td.psp-select-region,regular-table table th.psp-select-region{background-color:var(--icon--color)!important;color:var(--plugin--background)!important;border-color:var(--plugin--background)!important;}regular-table tbody tr:hover td.psp-select-region:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover+tr td.psp-select-region:not(.psp-row-selected):not(.psp-row-subselected){border-color:var(--plugin--background)!important;}regular-table tbody tr:hover td.psp-select-region.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected){box-shadow:inset -2px 0px 0px var(--plugin--background),inset 2px 0px 0px var(--plugin--background);}:host-context(perspective-viewer[settings]) td.psp-select-region.psp-menu-open{box-shadow:inset -2px 0px 0px var(--plugin--background),inset 2px 0px 0px var(--plugin--background);}regular-table #psp-column-edit-buttons th:not(.rt-group-corner) span:not(.rt-column-resize):before{content:var(--datagrid-column-edit-button--content,"Edit");}perspective-viewer:not([settings]) regular-table #psp-column-edit-buttons:after{content:none;}:host-context(perspective-viewer:not([settings])) regular-table #psp-column-edit-buttons:after{content:none;}regular-table table thead tr:last-child:after{width:10000px;box-sizing:border-box;display:block;height:23px;content:" ";border-bottom:1px solid var(--inactive--border-color);}regular-table table tbody tr:after{width:10000px;box-sizing:border-box;display:block;height:23px;content:" ";border-top:1px solid transparent;}regular-table table tbody tr:not(:first-child):after{border-top:1px solid var(--inactive--border-color);}regular-table table tbody tr:hover:not(:first-child):after{border-top:1px solid var(--rt-hover--border-color);}regular-table table tbody tr:hover+tr:after{border-top:1px solid var(--rt-hover--border-color);}@keyframes pulse_pos{0%{background-color:var(--pulse--background-color-start,rgba(0,128,255,0.5));}100%{background-color:var(--pulse--background-color-end,rgba(0,128,255,0));}}@keyframes pulse_pos2{0%{background-color:var(--pulse--background-color-start,rgba(0,128,255,0.5));}100%{background-color:var(--pulse--background-color-end,rgba(0,128,255,0));}}@keyframes pulse_neg{0%{background-color:var(--pulse--background-color-start,rgba(255,25,0,0.5));}100%{background-color:var(--pulse--background-color-end,rgba(255,25,0,0));}}@keyframes pulse_neg2{0%{background-color:var(--pulse--background-color-start,rgba(255,25,0,0.5));}100%{background-color:var(--pulse--background-color-end,rgba(255,25,0,0));}}';var J=class e extends HTMLElement{static#t=!1;static#e;static renderTarget=window.CSS?.supports&&window.CSS?.supports("selector(:host-context(foo))")?"shadow":"light";constructor(){super(),this.regular_table=document.createElement("regular-table"),this.regular_table.part="regular-table",this._is_scroll_lock=!1,this._edit_mode="READ_ONLY";let t=e;t.#e||(t.#e=new CSSStyleSheet,t.#e.replaceSync(qe)),t.renderTarget==="shadow"?this.attachShadow({mode:"open"}).adoptedStyleSheets.push(t.#e):t.renderTarget==="light"&&!t.#t&&(t.#t=!0,document.adoptedStyleSheets.push(t.#e))}connectedCallback(){this._toolbar||(this._toolbar=document.createElement("perspective-viewer-datagrid-toolbar"));let t=this.parentElement;t&&t.appendChild(this._toolbar)}disconnectedCallback(){this._toolbar?.parentElement?.removeChild?.(this._toolbar)}async activate(t){return await Fe.call(this,t)}get name(){return"Datagrid"}get category(){return"Basic"}get select_mode(){return"toggle"}get min_config_columns(){}get config_column_names(){return["Columns"]}get priority(){return 1}can_render_column_styles(t,r){return t!=="boolean"}column_style_controls(t,r){return oe.call(this,t,r)}async draw(t){return await Ye.call(this,t)}async update(t){if(this.model===void 0)await this.draw(t);else if(this.model._config.split_by?.length>0){let r=await t.dimensions();this.model._num_rows=r.num_view_rows,await this.regular_table.draw()}else this.model._num_rows=await t.num_rows(),await this.regular_table.draw()}async render(t){let r=await this.parentElement.getView(),s=await r.to_columns(t),o=await r.column_paths(t),l=t.end_row-t.start_row,i="";for(let n=0;n<l;n++){for(let a of o){let c=s[a],d=this.model._schema[a],p=Ie(d,this.regular_table[k][a.split("|").at(-1)]||{});p?i+=p.format(c[n])+" ":i+=c[n]+" "}i+=`
|
|
2
|
+
`}return i.trim()}async resize(){!this.isConnected||this.offsetParent==null||this._initialized&&await this.regular_table.draw()}async clear(){this.regular_table._resetAutoSize(),this.regular_table.clear()}save(){return je.call(this)}restore(t,r){return He.call(this,t,r)}async restyle(t){await this.draw(t)}delete(){this._toolbar=void 0,this.regular_table.table_model&&this.regular_table._resetAutoSize(),this.regular_table.clear()}};var Be=':host{position:relative;display:block;height:100%;}:host #container{position:absolute;display:flex;flex-direction:column;justify-content:stretch;align-items:stretch;top:0;left:0;right:0;bottom:0;}:host #toolbar{display:flex;align-items:stretch;height:100%;}:host #toolbar .hover-target{margin:0;display:inline-flex;align-items:center;cursor:pointer;}:host #toolbar .hover-target:hover{box-shadow:-4px 0 0 var(--icon--color),4px 0 0 var(--icon--color);background-color:var(--icon--color);}:host #slot-container{flex:1;position:relative;}#scroll_lock.lock-scroll:before{-webkit-mask-image:var(--toolbar-scroll-lock-active--content);}#scroll_lock:before{-webkit-mask-image:var(--toolbar-scroll-lock--content);}#select_mode:before{content:"highlight_alt";}#edit_mode:before{-webkit-mask-image:"";}#edit_mode[data-edit-mode="READ_ONLY"]:before{-webkit-mask-image:var(--toolbar-edit-mode--read-only--content);}#edit_mode[data-edit-mode="EDIT"]:before{-webkit-mask-image:var(--toolbar-edit-mode--edit--content);}:host(.aggregated) #toolbar #edit_mode[data-edit-mode="EDIT"]:before{-webkit-mask-image:var(--toolbar-edit-mode--read-only--content);}#edit_mode[data-edit-mode="SELECT_ROW"]:before{-webkit-mask-image:var(--toolbar-edit-mode--select-row--content);}#edit_mode[data-edit-mode="SELECT_COLUMN"]:before{-webkit-mask-image:var(--toolbar-edit-mode--select-column--content);}#edit_mode[data-edit-mode="SELECT_REGION"]:before{-webkit-mask-image:var(--toolbar-edit-mode--select-region--content);}#edit_mode[data-edit-mode="READ_ONLY"] span:before{content:var(--edit-mode--read-only--content,"Read Only");}#edit_mode[data-edit-mode="EDIT"] span:before{content:var(--edit-mode--edit--content,"Editable");}#edit_mode[data-edit-mode="SELECT_ROW"] span:before{content:var(--edit-mode--select-row--content,"Row Select");}#edit_mode[data-edit-mode="SELECT_COLUMN"] span:before{content:var(--edit-mode--select-column--content,"Column Select");}#edit_mode[data-edit-mode="SELECT_REGION"] span:before{content:var(--edit-mode--select-region--content,"Region Select");}#scroll_lock span:before{content:var(--scroll-lock-toggle--content,"Free Scroll");}#scroll_lock.lock-scroll span:before{content:var(--scroll-lock-alt-toggle--content,"Align Scroll");}.button:before{width:21px;height:21px;content:"";-webkit-mask-size:cover;mask-size:cover;background-color:var(--icon--color);}.button.editable:before,.button.lock-scroll:before{color:inherit;}.button{display:inline-flex;justify-content:center;align-items:center;user-select:none;padding:0 5px;border:1px solid transparent;border-radius:3px;border:1px solid transparent;box-sizing:border-box;display:inline-flex;font-size:var(--label--font-size,0.75em);height:22px;user-select:none;white-space:nowrap;width:37px;}.button>span{display:none;margin:0;padding:0;}.hover-target:focus-within .button,.hover-target:hover .button{position:relative;background-color:var(--icon--color);color:var(--plugin--background);opacity:1;display:flex;align-items:center;cursor:pointer;}.hover-target:focus-within .button:before,.hover-target:hover .button:before{background-color:var(--plugin--background);}.hover-target:focus-within .button>span,.hover-target:hover .button>span{display:block;position:absolute;top:calc(100% + 3px);left:50%;translate:-50%;margin:0;padding:5px;height:auto;white-space:pre-wrap;line-height:1;font-size:9px;background-color:var(--icon--color);width:35px;text-align:center;border-radius:0 0 3px 3px;}';var Ve=new CSSStyleSheet;Ve.replaceSync(Be);var K=class extends HTMLElement{connectedCallback(){if(this._initialized)return;this._initialized=!0,this.setAttribute("slot","plugin-settings"),this.attachShadow({mode:"open"}),this.shadowRoot.adoptedStyleSheets.push(Ve),this.shadowRoot.innerHTML=`
|
|
3
|
+
<div id="toolbar">
|
|
4
|
+
<span class="hover-target">
|
|
5
|
+
<span id="scroll_lock" class="button">
|
|
6
|
+
<span></span>
|
|
7
|
+
</span>
|
|
8
|
+
</span>
|
|
9
|
+
<span class="hover-target">
|
|
10
|
+
<span id="edit_mode" class="button" data-edit-mode="READ_ONLY">
|
|
11
|
+
<span></span>
|
|
12
|
+
</span>
|
|
13
|
+
</span>
|
|
14
|
+
</div>
|
|
15
|
+
`;let t=this.parentElement,r=this.previousElementSibling;r._scroll_lock=this.shadowRoot.querySelector("#scroll_lock"),r._scroll_lock.addEventListener("click",()=>V.call(r)),r._edit_button=this.shadowRoot.querySelector("#edit_mode"),r._edit_button.addEventListener("click",()=>{B.call(r),r.regular_table.draw(),t.dispatchEvent(new Event("perspective-config-update"))})}};async function bt(){customElements.define("perspective-viewer-datagrid-toolbar",K),customElements.define("perspective-viewer-datagrid",J),await customElements.whenDefined("perspective-viewer"),customElements.get("perspective-viewer").registerPlugin("perspective-viewer-datagrid")}bt();
|
|
16
|
+
//# sourceMappingURL=perspective-viewer-datagrid.js.map
|