• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import {Component, Input} from '@angular/core';
17import {TRACE_INFO} from 'app/trace_info';
18import {PersistentStore} from 'common/persistent_store';
19import {TraceType} from 'trace/trace_type';
20import {ImeUiData} from 'viewers/common/ime_ui_data';
21
22@Component({
23  selector: 'viewer-input-method',
24  template: `
25    <div class="card-grid">
26      <div class="left-views">
27        <hierarchy-view
28          class="hierarchy-view"
29          [tree]="inputData?.tree ?? null"
30          [dependencies]="inputData?.dependencies ?? []"
31          [highlightedItems]="inputData?.highlightedItems ?? []"
32          [pinnedItems]="inputData?.pinnedItems ?? []"
33          [tableProperties]="inputData?.hierarchyTableProperties"
34          [store]="store"
35          [userOptions]="inputData?.hierarchyUserOptions ?? {}"></hierarchy-view>
36
37        <ng-container *ngIf="inputData?.additionalProperties">
38          <mat-divider></mat-divider>
39
40          <ime-additional-properties
41            class="ime-additional-properties"
42            [additionalProperties]="inputData?.additionalProperties!"></ime-additional-properties>
43        </ng-container>
44      </div>
45
46      <mat-divider [vertical]="true"></mat-divider>
47
48      <properties-view
49        class="properties-view"
50        [userOptions]="inputData?.propertiesUserOptions ?? {}"
51        [propertiesTree]="inputData?.propertiesTree ?? {}"></properties-view>
52    </div>
53  `,
54  styles: [
55    `
56      .left-views {
57        flex: 1;
58        display: flex;
59        flex-direction: column;
60      }
61
62      .hierarchy-view,
63      .ime-additional-properties,
64      .properties-view {
65        flex: 1;
66        padding: 16px;
67        display: flex;
68        flex-direction: column;
69        overflow: auto;
70      }
71    `,
72  ],
73})
74export class ViewerInputMethodComponent {
75  @Input() inputData: ImeUiData | null = null;
76  @Input() store: PersistentStore = new PersistentStore();
77  @Input() active = false;
78  TRACE_INFO = TRACE_INFO;
79  TraceType = TraceType;
80}
81