debug-server-next
Version:
Dev server for hippy-core.
38 lines (37 loc) • 1.57 kB
JavaScript
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
import * as LitHtml from '../../../ui/lit-html/lit-html.js';
import elementsPanelLinkStyles from './elementsPanelLink.css.js';
export class ElementsPanelLink extends HTMLElement {
static litTagName = LitHtml.literal `devtools-elements-panel-link`;
shadow = this.attachShadow({ mode: 'open' });
onElementRevealIconClick = () => { };
onElementRevealIconMouseEnter = () => { };
onElementRevealIconMouseLeave = () => { };
set data(data) {
this.onElementRevealIconClick = data.onElementRevealIconClick;
this.onElementRevealIconMouseEnter = data.onElementRevealIconMouseEnter;
this.onElementRevealIconMouseLeave = data.onElementRevealIconMouseLeave;
this.update();
}
update() {
this.render();
}
connectedCallback() {
this.shadow.adoptedStyleSheets = [elementsPanelLinkStyles];
}
render() {
// clang-format off
LitHtml.render(LitHtml.html `
<span
class="element-reveal-icon"
=${this.onElementRevealIconClick}
=${this.onElementRevealIconMouseEnter}
=${this.onElementRevealIconMouseLeave}></span>
`, this.shadow);
// clang-format on
}
}
ComponentHelpers.CustomElements.defineComponent('devtools-elements-panel-link', ElementsPanelLink);