|
| 1 | +/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. |
| 2 | +
|
| 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 | +import { |
| 16 | + ChangeDetectionStrategy, |
| 17 | + Component, |
| 18 | + ViewEncapsulation, |
| 19 | +} from '@angular/core'; |
| 20 | + |
| 21 | +@Component({ |
| 22 | + selector: 'line-chart-unencapsulated', |
| 23 | + template: '', |
| 24 | + styles: [ |
| 25 | + /** |
| 26 | + * Why this weird hack? |
| 27 | + * The prospective fob area is absolutely positioned over the XAxis. |
| 28 | + * This prevents hover events from reaching the XAxis. |
| 29 | + * The .extent-edit-button should appear when the XAxis is hovered. |
| 30 | + */ |
| 31 | + ` |
| 32 | + .line-chart:has(.horizontal-prospective-area:hover) { |
| 33 | + .x-axis { |
| 34 | + .extent-edit-button { |
| 35 | + visibility: visible; |
| 36 | + } |
| 37 | + } |
| 38 | + } |
| 39 | + `, |
| 40 | + ], |
| 41 | + changeDetection: ChangeDetectionStrategy.OnPush, |
| 42 | + // This prevents the CSS generated from being namespaced thus allowing CSS |
| 43 | + // to reach into the line_chart_component and card_fob_controller_component |
| 44 | + encapsulation: ViewEncapsulation.None, |
| 45 | +}) |
| 46 | +export class LineChartUnencapsulated {} |
0 commit comments