1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import {BaseElement, element} from "../../base-ui/BaseElement.js"; 17import "../../base-ui/popover/LitPopover.js" 18import {LitPopover} from "../../base-ui/popover/LitPopover.js"; 19 20@element('sp-text') 21export class SpText extends BaseElement { 22 initElements(): void { 23 let litPopover = this.shadowRoot?.querySelector<LitPopover>('lit-popover'); 24 litPopover!.dataSource = [{ 25 text: "# Samples", 26 isSelected: true 27 },] 28 } 29 30 initHtml(): string { 31 return ` 32 <style> 33 :host{ 34 } 35 .root{ 36 display: flex; 37 flex-direction: column; 38 } 39 .trace-menu{ 40 grid-area: m; 41 } 42 .trace-content{ 43 grid-area: b; 44 width: 100%; 45 height: 2000px; 46 overflow: auto; 47 } 48 </style> 49 <div class="root"> 50 <div id="trace-content" class="trace-content"> 51 <img src="img/pic.png"> 52 <lit-popover direction="topleft" type="multiple-text" title=""> 53 <button>test</button> 54 </lit-popover> 55 </div> 56 </div> 57 `; 58 } 59}