perspective-viewer 5.9.1

The `<perspective-viewer>` Custom Element: a WebAssembly data grid, pivot table and charting UI for large, real-time and streaming datasets.
Documentation
/* ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
 * ┃ ██████ ██████ ██████       █      █      █      █      █ █▄  ▀███ █       ┃
 * ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█  ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄  ▀█ █ ▀▀▀▀▀ ┃
 * ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄   █ ▄▄▄▄▄ ┃
 * ┃ █      ██████ █  ▀█▄       █ ██████      █      ███▌▐███ ███████▄ █       ┃
 * ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
 * ┃ Copyright (c) 2017, the Perspective Authors.                              ┃
 * ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
 * ┃ This file is part of the Perspective library, distributed under the terms ┃
 * ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
 * ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
 */

:host([part~="tab"]) {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    height: 100%;
    min-width: 0;
    padding: 0 7px 0 13px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;

    /* Clip overflowing content, but allow the 4px fill shadows and the 1px
       separator lines (`::before`, 5px above/left of the tab) to paint
       outside the tab. `overflow: hidden` would clip the lines (a child
       box); `clip-path` clips at 6px out instead, 1px clear of the lines so
       their edges aren't cut by an un-snapped clip. Content can show at most
       6px past the tab, mostly under the fill. */
    clip-path: inset(-6px);
    position: relative;
    color: var(--psp--color, inherit);
    background: var(--psp-inactive--border-color, #ffffff) !important;
    /* Whole-pixel fill reaching 4px up/left/right, so it abuts (never
       overlaps) the frame's 1px separator lines and the 9px titlebar gap
       (see viewer.css `.rl-panel`). */
    box-shadow:
        2px -2px 0 2px var(--psp-inactive--border-color),
        -2px -2px 0 2px var(--psp-inactive--border-color);
}

:host([part~="tab"].visible) {
    z-index: 6;
    background: var(--psp--background-color, #ffffff) !important;
    /* box-shadow:
        2.25px -2.25px 0 2.25px var(--psp--background-color),
        -2.25px -2.25px 0 2.25px var(--psp--background-color),
        2.75px -2.75px 0 2.75px var(--psp-inactive--color),
        0 12.5px 0 -11.5px var(--psp-inactive--border-color); */
}

/* The panel's separator lines along the titlebar, in the panel's OWN theme
   (the tab is in the light DOM, so per-panel theme rules reach it; the frame
   can't). Real borders, snapped to device pixels like the plugin's outline.
   Covers this tab's slice of the frame's TOP line (5px above the tab, out to
   the middle of each 9px tab gap) and a LEFT line 5px left of the tab:

   - FIRST tab in a stack: lands on the frame's left edge, continuing the
     plugin outline's left line down the body.
   - Other tabs: lands in the middle of the gap (4px fill + 1px line + 4px
     neighbour fill), dividing it from the tab to its left.
   - Frame's top-left corner: covered by the first tab's top line, which runs
     to its left line.

   The LAST tab's top line ends exactly at the frame's right edge (the frame's
   4px right padding); the line beyond it is the right-hand neighbour's own
   left line. Ignores the pointer, so the resize grab band still reaches the
   layout. Inside the `clip-path: inset(-6px)` above. */
:host([part~="tab"])::before {
    content: "";
    position: absolute;
    top: -5px;
    bottom: 0;
    left: -5px;
    right: -4px;
    z-index: 1;
    box-sizing: border-box;
    border: 0 solid var(--psp-inactive--color);
    border-width: 1px 0 0 1px;
    pointer-events: none;
}

.psp-tab-grip {
    flex: 0 0 auto;
    width: 5px;
    height: 12px;
    margin-right: 10px;
    pointer-events: none;
    background-color: var(--psp-inactive--color);
    -webkit-mask-image: var(--psp-icon--column-drag-handle--mask-image);
    mask-image: var(--psp-icon--column-drag-handle--mask-image);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.psp-tab-caret {
    flex: 0 0 auto;
    display: none;
    margin-right: 12px;
    pointer-events: none;
}

.psp-tab-caret {
    /* content: " "; */
    display: block;

    width: 12px;
    height: 12px;
    pointer-events: none;
    background-color: var(--psp--color);
    /* -webkit-mask-image: var(--psp-icon--active-indicator--mask-image);
    mask-image: var(--psp-icon--active-indicator--mask-image); */
    -webkit-mask-image: var(--psp-icon--column-drag-handle--mask-image);
    mask-image: var(--psp-icon--column-drag-handle--mask-image);

    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

:host([part~="tab"].active) .psp-tab-caret {
    display: block;
    -webkit-mask-image: var(--psp-icon--active-indicator--mask-image);
    mask-image: var(--psp-icon--active-indicator--mask-image);
}

:host([part~="tab"].closing) {
    pointer-events: none;
}

/* A lone tab (its viewer has a single plugin child) has no stack to open —
 * no caret. Must follow the `.active` rule (equal specificity) to win when
 * the lone tab is also active. */
:host([part~="tab"].single) .psp-tab-caret {
    display: none;
}

.psp-tab-title {
    height: 11px;
    line-height: 12px;
    flex: 1 1 auto;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psp-tab-title.placeholder {
    color: var(--psp-inactive--color);
}

.psp-tab-title.input-sizer {
    flex: 1 1 auto;
    pointer-events: auto;
    display: inline-block;
    position: relative;
    min-width: 24px;
}

.input-sizer::after {
    content: attr(data-value) " ";
    visibility: hidden;
    white-space: nowrap;
    padding-right: 2px;
}

.input-sizer input {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-overflow: ellipsis;
    outline: none;
}

span#rows {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-left: 12px;
    margin-right: 6px;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 100000000 auto;
}

span#rows span.x,
span#rows span.total {
    text-overflow: ellipsis;
    color: var(--psp-inactive--color);
}

.psp-tab-master {
    margin-right: 6px;
}

.psp-tab-master:before {
    content: var(--psp-broadcast--content, "[BROADCAST]");
}

.psp-tab-close,
.psp-tab-settings {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

.psp-tab-close:hover::before,
.psp-tab-settings:hover::before {
    background-color: var(--psp--color);
}

.psp-tab-close::before,
.psp-tab-settings::before {
    content: "";

    /* TODO don't hard-code dimensions */
    width: 20px;
    height: 20px;
    background-color: var(--psp-inactive--color);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.psp-tab-close::before {
    -webkit-mask-image: var(--psp-icon--close--mask-image);
    mask-image: var(--psp-icon--close--mask-image);
}

.psp-tab-settings::before {
    -webkit-mask-image: var(--psp-icon--drawer-tab-inverted--mask-image);
    mask-image: var(--psp-icon--drawer-tab-inverted--mask-image);
}